New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show-Command's "Run" doesn't actually run with PSReadline #198

Open
lzybkr opened this Issue Jan 30, 2015 · 2 comments

Comments

Projects
None yet
3 participants
@lzybkr
Owner

lzybkr commented Jan 30, 2015

Repro:

  • Show-Command
  • Pick a command, set Get-Culture
  • Click on Run

Expected:
the command runs
Actual:
The command now looks like:
PS> Get-Culture^M

@ngetchell

This comment has been minimized.

ngetchell commented Aug 28, 2017

Just ran into this.

@lzybkr lzybkr added the bug label Nov 8, 2017

@Chirishman

This comment has been minimized.

Chirishman commented Dec 29, 2017

Yep, still an issue

Edit:

Looks like Show-Command prints an ascii 13 carriage return. Running the below fixed Ctrl+M entering ^M but not the issue with Show-Command's run function.

Set-PSReadlineKeyHandler -Chord 'Ctrl+M' -Function AcceptLine

Edit 2:

This should work but I can't figure out how to trigger it.

$pattern = $null
[Microsoft.PowerShell.PSConsoleReadLine]::GetBufferState([ref]$pattern, [ref]$null)
if (-not(-not([char[]]$pattern -eq 13))){
    [Microsoft.PowerShell.PSConsoleReadLine]::AcceptLine()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment