Skip to content

Powershell editing a previous command #4058

@greg-10101

Description

@greg-10101

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues, especially the pinned issues.

Exception report

Last 200 Keys:
 e 7 a 1 8 A A A B D 1 6 D N X u i T 5 u C k k d l k B 5 X A A C H n 3 v k A A A = " Enter
 N e w - M g U s e r C a l e n d a r E v e n t Space - U s e r I d Space $ u s e r I d Space - C a l e n d a r I d Space $ c a l e n d a r I d Space - B o d y P a r a m e t e r Space $ p a r a m s Enter
 UpArrow UpArrow UpArrow Home UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow DownArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow Home Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete Delete

Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
   at System.Management.Automation.Language.SemanticChecks.VisitHashtable(HashtableAst hashtableAst)
   at System.Management.Automation.Language.HashtableAst.InternalVisit(AstVisitor visitor)
   at System.Management.Automation.Language.CommandExpressionAst.InternalVisit(AstVisitor visitor)
   at System.Management.Automation.Language.AssignmentStatementAst.InternalVisit(AstVisitor visitor)
   at System.Management.Automation.Language.StatementBlockAst.InternalVisit(AstVisitor visitor, ReadOnlyCollection`1 traps, ReadOnlyCollection`1 statements, AstVisitAction action)
   at System.Management.Automation.Language.NamedBlockAst.InternalVisit(AstVisitor visitor)
   at System.Management.Automation.Language.ScriptBlockAst.InternalVisit(AstVisitor visitor)
   at System.Management.Automation.Language.SemanticChecks.CheckAst(Parser parser, ScriptBlockAst ast)
   at System.Management.Automation.Language.ScriptBlockAst.PerformPostParseChecks(Parser parser)
   at System.Management.Automation.Language.Parser.ParseTask(String fileName, String input, List`1 tokenList, Boolean recursed, ParseMode parseMode)
   at System.Management.Automation.Language.Parser.Parse(String fileName, String input, List`1 tokenList, ParseError[]& errors, ParseMode parseMode)
   at System.Management.Automation.Language.Parser.ParseInput(String input, String fileName, Token[]& tokens, ParseError[]& errors)
-----------------------------------------------------------------------

Screenshot

image

Environment data

PS Version: 5.1.17763.5933
PS HostName: ConsoleHost
PSReadLine Version: 2.0.0-beta2
PSReadLine EditMode: Windows
OS: 10.0.17763.1 (WinBuild.160101.0800)
BufferWidth: 120
BufferHeight: 3000

Steps to reproduce

Tap up-arrow to previous command and attempt to remote the transactionId line using the delete key

Expected behavior

No crash

Actual behavior

Crash

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions