peterh/liner

Alt+Left/Right does not work on macOS

Closed this issue · 2 comments

Typical macOS terminal application uses ⌥ (alt) + ←/→ for movements between words. Those combinations send [1;5D for ⌥+← and 1;5C for ⌥+→. And they to do not work with liner.

README mentions Alt-B and Alt-F, but those combinations type and ƒ as expected on macOS.

TERM=xterm-256color
TERM_PROGRAM=iTerm.app
TERM_PROGRAM_VERSION=3.2.0

That's... non-standard, isn't it? My Terminal.app configuration/Keyboard says that ⌥ ← (and →) sends \033b (and \033f). \033[1;5D is ^← (control ←). Either should work, however.

To use Alt- combinations, you have to turn on Terminal.app configuration/Keyboard/Use Option as Meta Key, or you get ∫ and ƒ instead of an actual Alt-key combination sent to the app.

Note that System Preferences/Keyboard/Shortcuts can override any combination (eg. ^← is overridden by default to mean "Mission Control / Move left a space"). You have to turn off any combinations you want passed through to Terminal.

For the most part, if it works in bash, it should work the same way in liner.

Hi, sorry for a late response. I was under impression that my configuration was standard… but apparently, it was not, as I discovered after playing with iTerm settings.
It works now. Thank you.