xtermjs / xterm.js

A terminal for the web
https://xtermjs.org/
MIT License
17.42k stars 1.62k forks source link

Remove alt -> ctrl+arrow hack in favor of embedder-specific solutions #4538

Open Tyriar opened 1 year ago

Tyriar commented 1 year ago

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

fifv commented 9 months 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):

  1. Open the file contains xterm.js's bundled codes (C:\Users\<USER>\AppData\Local\Programs\Tabby\resources\builtin-plugins\tabby-terminal\dist\index.js)

    • This is xterm.js ‘s problem, and Tabby use xterm.js as a plugin, note it belongs to builtin-plugins instead of main tabby app
  2. Fix for Arrows:

    Find [1;5D (may ~27452 at Tabby 1.0.196)

    Remove these selected

    image

  3. Fix for PageUp/PageDown:

    Find [5~ (may ~27479 at Tabby 1.0.196, just near the above ones)

    Add these selected

    image

dmarcuse commented 4 weeks ago

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.

Tyriar commented 4 weeks ago

@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).

dmarcuse commented 4 weeks ago

Sounds good, I'll set aside some time to work on this over the weekend then.