Lurker News
OSX Terminal: hold option and click a position in the current line to move your cursor to that position. #yearslost

Comments (395) 107 threads

Show all comments

Showing thread 13 of 107

ghotli3 replies#
Osx terminal uses almost all of the emacs movement keys by default. Ctrl-a and ctrl-e are useful but I find the meta movement keys to be the most helpful. (usually alt or ESC)

Meta-f jump forward a word
Meta-b jump backwards a word

pyre#
I'm not sure what you're suggesting here.

It's up to the process running in Terminal.app to support the key sequences sent to it. I doubt that M-f would work if your shell (bash, zsh, etc) were in Vi-mode rather than the default of Emacs-mode.

pyre#
IIRC, someone mentioned to me once that bash doesn't link against libreadline, but uses libreadline (the source is directly in the Bash repo), so it's possible that it's using GNU readline, while Apple's libreadline is a BSD flavour.
SeanLuke2 replies#
Terminal may be using some kind of Readline, I dunno. But text objects in other OS X applications use emacs keybindings because NeXTSTEP has had them since time immemorial. Like 1990 or so. Doesn't have anything to do with GNU Readline so far as I know.
tadfisher#
It's not Terminal that uses it; it's bash, and most shells that imitate bash.
pyre#
> Terminal may be using some kind of Readline

Terminal.app passes the key sequences to the application running inside of the terminal. The default shell (bash) uses GNU readline, which has an emacs-mode and a vi-mode (emacs is the default).
Terminal.app does not use any Cocoa text fields, so has nothing to do with the Emacs keybindings inherited from NeXTSTEP.

dded#
It at least used to be the case that GNU Readline was GPL-licensed, instead of LGPL, as to make readline a "carrot" to encourage GPL adoption. That shouldn't be an issue for bash, which is also GPL licensed.
KC8ZKF#
That's bash. Works on all platforms, all terminals, as long as bash has been compiled with readline.