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

The key combination "Ctrl+j" in VSCode powerShell terminal failed to be assigned as PSReadLineKeyHandler #5033

Open
5 of 6 tasks
ryan-workFromHome opened this issue Aug 26, 2024 · 2 comments
Labels
Issue-Bug A bug to squash. Needs: Maintainer Attention Maintainer attention needed!

Comments

@ryan-workFromHome
Copy link

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all open and closed issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
  • If this is a security issue, I have read the security issue reporting guidance.

Summary

The key combination "Ctrl+j" in VSCode powerShell terminal failed to be assigned as PSReadLineKeyHandler

  1. I've removed all of the "Ctrl+j" in the VSCode Keyboard Shortcuts menu.
  2. My VSCode terminal using vscode-powerShell v2024.2.2 has the "Ctrl+j" being set as "AcceptLine".

However, this "Ctrl+j" key combination has no effect in the VSCode terminal using PowerShell.
In contrast, while working on the "ipython" opened in this vscode-powershell, the "Ctrl+j" works perfectly, but it doesn't work in vscode-powershell itself.
image

Moreover, the plain powershell window or powershell inside "Windows Terminal" are all working well while pressing "Ctrl+j" which stands for the AcceptLine in my setting.
image

Furthermore, the same methodology works well on any other key combinations.
The following figure use the "Ctrl+g" as an example.
image

PowerShell Version

Name                           Value
----                           -----
PSVersion                      7.4.5
PSEdition                      Core
GitCommitId                    7.4.5
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Name             : ConsoleHost
Version          : 7.4.5
InstanceId       : 8db42014-6a39-4233-8b71-3bbed5dbfae0
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : en-US
CurrentUICulture : en-US
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace

Visual Studio Code Version

1.92.2
fee1edb8d6d72a0ddff41e5f71a671c23ed924b9
x64

Extension Version

Steps to Reproduce

  1. Open powershell inside the VSCode
  2. Set "Ctrl+j" as any function. (I want to set it as function AcceptLine)
    set-PSReadLineKeyHandler -Key "Ctrl+j" -function AcceptLine
  3. Press the key combination "Ctrl+j" in the vscode-powershell window, and you would see nothing happening.

Visuals

No response

Logs

No response

@ryan-workFromHome ryan-workFromHome added Issue-Bug A bug to squash. Needs: Triage Maintainer attention needed! labels Aug 26, 2024
@SydneyhSmith
Copy link
Collaborator

Thanks @ryan-workFromHome can you try disabling your other extensions besides PowerShell to see if it still repros?

@SydneyhSmith SydneyhSmith added Needs: Author Feedback Please give us the requested feedback! and removed Needs: Triage Maintainer attention needed! labels Sep 12, 2024
@ryan-workFromHome
Copy link
Author

ryan-workFromHome commented Sep 12, 2024

Thanks @ryan-workFromHome can you try disabling your other extensions besides PowerShell to see if it still repros?

The issue persists with all of the extensions being disabled.
So it seems not induced by the extensions.

@github-actions github-actions bot added Needs: Maintainer Attention Maintainer attention needed! and removed Needs: Author Feedback Please give us the requested feedback! labels Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug A bug to squash. Needs: Maintainer Attention Maintainer attention needed!
Projects
None yet
Development

No branches or pull requests

9 participants
@SydneyhSmith @ryan-workFromHome and others