Skip to content

git commit command cancels when first apostrophe for the descripting message is typed #3694

@JoGuirre

Description

@JoGuirre

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:
 p l e Space o f Space c u s t o m Space c o m p o n e n t s ' Enter
 g Backspace c d Space . . Enter
 l s Enter
 c d Space p r o f - p o r t - v 1 Enter
 l s Enter
 g i t Enter
 g i t Space h e l p Space - a Enter
 g i t Space a d d Space . Enter
 g i t Space a d d Space . Enter
 g i t Space a d d Space . Enter
 n p m Space i Space r e a c t - r o u t e r - d o m Enter
 g i t Space a d d Space . Enter
 g i t Space c o m m i t Space - m Space ' g i t Space a d d Space . Enter
 g i t Space c o m m i t Space - Space m ' g i t Space a d d Space . Enter
 g i t Space c o m m i t Space - m Space '

Exception:
System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
Parameter name: left
Actual value was -1.
   at System.Console.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.Internal.VirtualTerminal.set_CursorLeft(Int32 value)
   at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
   at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
   at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)

Screenshot

Screenshot 2023-05-18 091123

Environment data

PS Version: 5.1.19041.2673
PS HostName: ConsoleHost
PSReadLine Version: 2.0.0-beta2
PSReadLine EditMode: Windows
OS: 10.0.19041.1 (WinBuild.160101.0800)
BufferWidth: 59
BufferHeight: 3000

Steps to reproduce

Typing the first apostrophe in the command git commit -m 'message' causes this issue.

Expected behavior

To be able to write the full command, and add a descripting message to the commit.

Actual behavior

Cancels the command. After the command is cancelled, I can try the git commit -m 'message' command again, and it will complete. However, there is no highlighting of git at this point.

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