Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's because alt-arrow isn't a ANSI control sequence. What should it map to? You can see what your terminal is sending with this command:

    stty -icanon -echo; od -c
Hit your key sequence then hit return a bunch of times until the line comes out. You'll see some sort of ESC sequence.

When done, control-c then type "stty sane" (it will not echo).

For iTerm I get "\e[1;9D". Terminal, interestingly is giving me "\e\eD". When I turn off my "Use option as meta key" preference in Terminal it gives me "\eD". Which is the same as plain left arrow.

Also, neither of those escape sequences does anything in bash for me.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: