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

Feature request - Terminal - Support for bash shortcuts #215

Closed
8nrGDjC5NgWS opened this issue Jan 2, 2019 · 3 comments
Closed

Feature request - Terminal - Support for bash shortcuts #215

8nrGDjC5NgWS opened this issue Jan 2, 2019 · 3 comments

Comments

@8nrGDjC5NgWS
Copy link

  • Version (cloudcmd -v): v11.8.3
  • Node Version node -v: v11.3.0
  • OS (uname -a on Linux): Linux cloudcmd 4.14.82-gentoo-20181125-1328 Node.js 0.7 is no longer provided on travis-ci.org #1 SMP Sun Nov 25 13:33:05 CST 2018 x86_64 GNU/Linux
  • Browser name/version: Google Chrome Version 71.0.3578.98 (Official Build) (64-bit)
  • Used Command Line Parameters: --root /data --prefix cloudcmd --no-open --terminal --terminal-path gritty --no-console
  • Changed Config: (Not sure what this is)

Is it possible to have support for the bash shortcuts when in terminal? I.e. Ctrl-w, Ctrl-a, Ctrl-e, Ctrl-k, etc?

I discovered that Ctrl-w closes completely the browser tab instead of deleting the last word, as I had expected.

@coderaiser
Copy link
Owner

coderaiser commented Jan 2, 2019

That's possible, file client/modules/terminal.js should be edited for this purpose, it can be something like this on show:

window.addEventListener('keydown', (e) => {
    const W = 87; 
    if (e.ctrlKey && e.keyCode === W)
        e.preventDefault();
});

And window.removeEventListener('keydown') on hide.

@coderaiser
Copy link
Owner

coderaiser commented Jan 8, 2019

Also preventDefault can be added to client/key/index.js and addW to client/key/key.js.

@coderaiser
Copy link
Owner

Closed due to inability to handle Ctrl + W with help of preventDefault. Could be revised when xterm will have ability to remap keys in xtermjs/xterm.js#487 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants