vscode-powershell icon indicating copy to clipboard operation
vscode-powershell copied to clipboard

(Preview) PSReadLine Keyboard Commands do not work in the PowerShell Integrated Console (OSX)

Open eedwards-sk opened this issue 6 years ago • 10 comments

System Details Output

### VSCode extensions:
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]


### PSES version: 2.0.0.0

### PowerShell version:

Name                           Value
----                           -----
PSVersion                      7.0.0-preview.2
PSEdition                      Core
GitCommitId                    7.0.0-preview.2
OS                             Darwin 18.7.0 Darwin Kernel Version 18.7.0: Thu Jun 20 18:42:21 PDT 2019; root:xnu-4903.270.47~4/RELEASE_X86_64
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Issue Description

PSReadLine Keyboard Commands do not work in the PowerShell Integrated Console

Expected Behaviour

Using keyboard combinations which are bound are executed.

Actual Behaviour

Attempting to use any keyboard commands does not work.

e.g. pressing Ctrl+l does nothing, even though it's bound by default to the below action

Ctrl+l        ClearScreen       Clear the screen and redraw the current line at the top of the screen

Attached Logs

N\A

Additional Notes

[email protected] is disabled, I'm using [email protected]

eedwards-sk avatar Aug 01 '19 04:08 eedwards-sk

@eedwards-sk thanks for opening this issue, it looks like this is a unix specific bug... @TylerLeonhardt might have more context on this

SydneyhSmith avatar Aug 01 '19 21:08 SydneyhSmith

Hmm I can't repro this behavior. Ctrl+l does clear the screen for me.

@eedwards-sk what version of PSReadLine do you have? (Get-Module PSReadLine)

TylerLeonhardt avatar Aug 01 '19 22:08 TylerLeonhardt

Get-Module PSReadLine does not work from inside the integrated terminal.

If from inside the terminal I then run pwsh-preview (so it's running an interactive session with pwsh-preview directly), then Get-Module PSReadLine works fine (returning 2.0.0) and keyboard shortcuts work as expected.

eedwards-sk avatar Aug 01 '19 22:08 eedwards-sk

Also, manually importing PSReadLine inside the integrated terminal session (Import-Module PSReadLine) does allow Get-Module PSReadLine to return, however it does not cause keyboard shortcuts to work.

eedwards-sk avatar Aug 01 '19 22:08 eedwards-sk

I'll need to talk to @rjmholt about this. I suspect it has something to do with how we're loading PSReadLine at start up...

Do you happen to have PowerShell 6.2 available? I'd like to see if the issue happens with that version as well

TylerLeonhardt avatar Aug 02 '19 00:08 TylerLeonhardt

Not exactly sure how to tell VSCode which psversion to use, but after installing ps6.2, it did switch to it.

I was able to repro on 6.2 as well.

PS /Users/eedwards/dev/mise> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.2.2
PSEdition                      Core
GitCommitId                    6.2.2
OS                             Darwin 18.7.0 Darwin Kernel Version 18.7.0: Thu Jun 20 18:42:21 PDT 2019; root:xnu-4903.270.47~4/RELEASE_X86_64
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Get-Module PSReadLine returns nothing, and Import-Module PSReadLine works to allow Get-Module PSReadLine, but still doesn't provide any readline functionality.

Works fine if I run pwsh from inside the integrated console.

So basically, exact same symptoms with 6.2 as with 7.0preview2

eedwards-sk avatar Aug 09 '19 18:08 eedwards-sk

This issue is being closed as inactive, if this issue is still occurring it will be re-opened

ghost avatar Aug 15 '19 00:08 ghost

Still Occurring...

eedwards-sk avatar Aug 15 '19 01:08 eedwards-sk

Bot is trigger happy

TylerLeonhardt avatar Aug 15 '19 14:08 TylerLeonhardt

Hey @eedwards-sk, is this still an issue with the latest preview?

andyleejordan avatar Mar 31 '22 00:03 andyleejordan