PowerShell / PowerShell/vscode-powershell
The key combination "Ctrl+j" in VSCode powerShell terminal failed to be assigned as PSReadLineKeyHandler
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.9k
- Forks
- 547
- PR merge metrics
- No merged PRs in 30d
Description
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
- I've removed all of the "Ctrl+j" in the VSCode Keyboard Shortcuts menu.
- 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.
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.
Furthermore, the same methodology works well on any other key combinations.
The following figure use the "Ctrl+g" as an example.
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
ms-vscode.powershell@2024.2.2
Steps to Reproduce
- Open powershell inside the VSCode
- Set "Ctrl+j" as any function. (I want to set it as function AcceptLine)
set-PSReadLineKeyHandler -Key "Ctrl+j" -function AcceptLine - Press the key combination "Ctrl+j" in the vscode-powershell window, and you would see nothing happening.
Visuals
No response
Logs
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue in the VS Code PowerShell terminal with set-PSReadLineKeyHandler -Key "Ctrl+j" -function AcceptLine, then compare it with Ctrl+g and standalone PowerShell behavior. Review the extension's keyboard handling alongside docs/troubleshooting.md; done means Ctrl+j invokes the configured PSReadLine handler in the integrated terminal.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell, typescript, vscode
- Domain
- cli, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100