Skip to content
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
Open

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

lzybkr opened this issue Jan 30, 2015 · 2 comments
Labels

Comments

@lzybkr
Copy link
Member

@lzybkr 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
Copy link

@ngetchell ngetchell commented Aug 28, 2017

Just ran into this.

@lzybkr lzybkr added the Issue-Bug label Nov 8, 2017
@Chirishman
Copy link

@Chirishman 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()
}
@daxian-dbw daxian-dbw added this to the 3.0.0-Consider milestone Dec 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants