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

Powershell hot key ctrl j and ctrl w #3890

Closed
Xdminsy opened this issue Dec 9, 2019 · 2 comments
Closed

Powershell hot key ctrl j and ctrl w #3890

Xdminsy opened this issue Dec 9, 2019 · 2 comments
Labels
Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@Xdminsy
Copy link

Xdminsy commented Dec 9, 2019

#Environment

Windows build number: Microsoft Windows [Version 10.0.18362.356]
Windows Terminal version (if applicable): 0.7.3382.0


Any other software?
Powershell Core: 7.0.0-preview.6

I used to bind ctrl+j to enter and use ctrl+w to backward delete word. I have

Set-PSReadLineOption -BellStyle None -EditMode Emacs

emacs edit mode enabled in my powershell.
The ctrl+w works differently in powershell and in powershell in windows terminal.
If I input Get-Command and type ctrl+w, only the Command wil be deleted in powershell.
But in Windows terminal the Get- will be deleted as well.
I don't understand why, but if I explicitly add this to $PROFILE

Set-PSReadLineKeyHandler -Chord ctrl+w -Function BackwardDeleteWord

It works in terminal as expected.

Though ctrl+w can work as expected if I add one line, the ctrl+j cannot work,

Set-PSReadLineKeyHandler -Chord ctrl+j -Function AcceptLine

In powershell I can use ctrl+j instead of Enter key to run command.
But in powershell in Windows Terminal this doesn't work, ctrl+j do nothing even if I mapped it to something.
Other keys seem to work, I only found the binding for ctrl+j won't work.
I thought terminal deals with ctrl+j itself instead of sending it to powershell, but I tried mapping ctrl+j in vim running in terminal it worked.

So I don't understand why these happen, why?

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Dec 9, 2019
@DHowett-MSFT
Copy link
Contributor

This is probably related to PSReadline - I just tried in an application issuing raw ReadConsoleInputW calls and received the ^J out the other end as expected.

(dhowett-dev2) ~ % E:\ReadConsoleInputW.exe
UNICODE. ^Z TO EXIT
--
  REP   VK  VSC CHAR          CTRL
- --- ---- ---- ---- ---- --------
v 001 0011 001d 0000 ^@   00000008
v 001 000d 001c 000a ^J   00000008
^ 001 000d 001c 000a ^J   00000008
^ 001 0011 001d 0000 ^@   00000000

It may be a /dupe of #879.

@ghost
Copy link

ghost commented Dec 9, 2019

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost ghost closed this as completed Dec 9, 2019
@ghost ghost added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Dec 9, 2019
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

2 participants