Open Tyriar opened 1 year ago
Thank you Tyriar for saving my life. I have spent hours to figure out why my Alt key doesn't work...
For anyone who wants a workaround, here is my hack for Tabby
(other terminals should be similar):
Open the file contains xterm.js's bundled codes (C:\Users\<USER>\AppData\Local\Programs\Tabby\resources\builtin-plugins\tabby-terminal\dist\index.js
)
builtin-plugins
instead of main tabby appFix for Arrows:
Find [1;5D
(may ~27452 at Tabby 1.0.196)
Remove these selected
Fix for PageUp/PageDown:
Find [5~
(may ~27479 at Tabby 1.0.196, just near the above ones)
Add these selected
Is there any recent update on this? I've been frustrated by this behavior in VS code and finally figured out this was the cause (and found the linked workaround via VS code's shortcuts). I see the help wanted tag - if it's just a matter of getting someone to do it, I'm happy to make the changes.
@dmarcuse no updates, just needs someone to help out. We'll need this removed in xterm.js and then some default keybindings added to VS Code. So then disabling this in VS Code would be a matter or disabling keybindings (as opposed to creating new ones which is more difficult).
Sounds good, I'll set aside some time to work on this over the weekend then.
You could just "fix" it by simply override the key binding if you're using vscode. Maybe the workbench.action.terminal.sendSequence
action does not send sequences via xterm.js, but through conpty directly, so it would not be modified?
{
"key": "alt+left",
"command": "workbench.action.terminal.sendSequence",
"args": {
"text": "\u001b[1;3D"
},
"when": "terminalFocus"
},
{
"key": "alt+right",
"command": "workbench.action.terminal.sendSequence",
"args": {
"text": "\u001b[1;3C"
},
"when": "terminalFocus"
},
Result:
@balthild yep, we just need that keybinding built in to VS Code. So those keybindings added somewhere over here: https://github.com/microsoft/vscode/blob/3ae6c5ef651585b12870828230f214eed2e6ef07/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts#L245-L249
And then remove the overrides from xterm.js
Context: https://github.com/xtermjs/xterm.js/issues/264#issuecomment-1505538266
Finding the commit they were added to confirm is also a good idea.
https://github.com/xtermjs/xterm.js/blob/8b422442b7079525dca8b2a1c6b167856d1d7e7e/src/common/input/Keyboard.ts#L114-L189