tty.js icon indicating copy to clipboard operation
tty.js copied to clipboard

Option-N Shortcut don't work

Open azer opened this issue 12 years ago • 3 comments

I binded option-n shortcut to create new projects in Emacs, I can't get this shortcut working while emacs works and looks perfect in tty.js.

Thanks!

azer avatar Sep 14 '13 06:09 azer

Are you using chrome? Unfortunately, ctrl-n is unbindable on chrome: https://code.google.com/p/chromium/issues/detail?id=33056

However, you said option-n (not command-n) which should be equivalent to alt-n, so I'm really not sure. Maybe it's different for macs.

chjj avatar Sep 14 '13 19:09 chjj

yeah, it's alt-n not working unfortunately...

azer avatar Sep 14 '13 22:09 azer

Is it only alt-n that is not working? The alt+ code resides here, and it includes n: https://github.com/chjj/term.js/blob/master/src/term.js#L2598 This means that if any other alt combination works, n should work.

Another possibility is...

The way terminals work is: when alt + a character is pressed, depending on whether 8bit input is used, the byte will get OR'd with (1 << 7), otherwise an escape character (0x1b) will be prepended to the character that was pressed. Which means if you do: alt-n, you would get 238, otherwise you would get '^[n' respectively. It's up to the program to determine what's going on. Maybe emacs bindings assume a mode? I'm not sure.

chjj avatar Sep 14 '13 22:09 chjj