Cmd+Arrow keys on Mac have suddenly stopped skipping words and instead emit "D" and "C"

299 views
Skip to first unread message

ericre...@google.com

unread,
Oct 24, 2017, 3:59:02 AM10/24/17
to chromium-hterm
I have noticed this behaviour since yesterday, but perhaps it was happening already before then.

To reproduce, on a Mac:

1. Open an SSH session, any will do.
2. Type some string with word breaks, for example, "aaa/bbb/ccc"
3. Press Cmd+Left. Instead of moving the cursor to the beginning of "ccc" which is what used to happen, instead "D" is appended.
4. Go to the beginning of the line. Press Cmd+Right. "C" is inserted instead of moving the cursor to the end of "aaa".

In your bug report guide you mention sending a recording of the session to facilitate debugging, but I could not find instructions on how to do this.

Thanks!

Eric

ericre...@google.com

unread,
Oct 24, 2017, 4:01:43 AM10/24/17
to chromium-hterm, ericre...@google.com
Please note, the same applies to Option+Arrow, though these combinations work fine for me on the native Mac terminal.

ericre...@google.com

unread,
Oct 24, 2017, 4:34:12 AM10/24/17
to chromium-hterm, ericre...@google.com
Also just noticed that Cmd+Backspace and Option+Backspace are still working as expected.

Mike Frysinger

unread,
Oct 24, 2017, 1:59:54 PM10/24/17
to ericre...@google.com, chromium-hterm
Command is the Meta modifier.  when you press command+left arrow, it (now correctly) emits \e[1;9D.  previously it would emit \e[1;1D because we never checked the state of the Meta key, but i fixed that:

you can read more about it here:

if you want to have meta+arrow keys advance words, you can update your ~/.inputrc:
"\e[1;9C": forward-word
"\e[1;9D": backward-word
$include /etc/inputrc
-mike

--
You received this message because you are subscribed to the Google Groups "chromium-hterm" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-hterm/258d03d4-d7ee-4774-b189-abf7ce9de7a7%40chromium.org.

Feng Zhao

unread,
Oct 24, 2017, 7:43:41 PM10/24/17
to chromium-hterm, ericre...@google.com
Thank you. This solution worked for me.

Eric Reynolds

unread,
Oct 25, 2017, 3:27:11 AM10/25/17
to Feng Zhao, chromium-hterm
Thanks very much for promptly providing a solution!

che...@google.com

unread,
Mar 10, 2018, 10:57:44 AM3/10/18
to chromium-hterm, ericre...@google.com
I am using tmux in Secure Shell. This solution doesn't work.
Do you know how to make it work in tmux?
Thanks.

On Tuesday, October 24, 2017 at 10:59:54 AM UTC-7, Mike Frysinger wrote:

Mike Frysinger

unread,
Mar 10, 2018, 12:03:16 PM3/10/18
to che...@google.com, chromium-hterm, Eric Reynolds
please describe in depth what it is you've tried, how you tried it, and what isn't working

i don't have access to a macOS system atm to check this specific scenario.  you can try using Ctrl+V in the shell session and then pressing the key combo to double check what the remote shell is receiving (in case tmux did something to the sequence).
-mike

zug...@google.com

unread,
May 16, 2019, 4:54:04 PM5/16/19
to chromium-hterm, che...@google.com, ericre...@google.com
I just replaced my Macbook Pro with a new one, and in this new one, Option+left prints D in Secure Shell app, and Option+right prints C. previously the behavior is to move the cursor for one word. anything I can do to fix this? (using Ctrl instead of Option would also work for me, which ATM also prints out D or C)

thanks!

Mike Frysinger

unread,
May 18, 2019, 7:45:16 AM5/18/19
to zug...@google.com, chromium-hterm, Shi Chen, Eric Reynolds

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-hter...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-hterm/bbc64c22-b305-41ea-8067-bcb7adae9e36%40chromium.org.
Reply all
Reply to author
Forward
0 new messages