0

Why do macOS specific terminal shortcuts like Left-arrow + Option work in a remote shell on Ubuntu with a dedicated pty?

I'm trying to understand why macOS specific terminal shortcuts like Left-arrow + Option for moving one word to the left in Bash work in a remote shell on Ubuntu.

The tty output in the remote shell:

$ tty
/dev/pts/0

Normally, Ubuntu expects ALT + b for moving one word to the left in Bash.

Does it work, because there is a local pty that maps Left-arrow + Option to something generic that the remote pty understands? If so, how can I see the name of the local pty?

5
  • What are the contents of ~/.inputrc on the remote Ubuntu system? Also, if these are options you've set in your graphical terminal emulator, then I guess it's the terminal emulator that's doing the translation anyway. Both on your local machine and on the remote. – terdon Jul 15 '19 at 12:01
  • @terdon - ~/.inputrc doesn't exist on the remote system. Can you confirm my assumption that there are two terminals in play, namely the local and the remote ones? If so, how can I see the name of the local one, while in the remote shell? – Shuzheng Jul 15 '19 at 12:44
  • I think it's just your GUI that's doing it. Try connecting to the remote using a different terminal emulator. xterm for instance. I expect the shortcuts won't work. – terdon Jul 15 '19 at 12:48
  • GUI? Don't you mean local terminal? – Shuzheng Jul 15 '19 at 13:28
  • 1
    Yes, I mean whatever graphical application you are using as a terminal emulator. I believe the default on macOS is iTerm? Try using another one and see if the shortcuts work. I expect these shortcuts you're talking about are handled by whatever terminal app you are using. – terdon Jul 15 '19 at 13:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.