Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running the python console in my terminal on OSX and I would like to know if there are any keyboard shortcuts for navigating to the next/previous word or to the beginning or end of the line.

In my text editor for example I can use CMD + RIGHT ARROW to get to the end of a line, but this doesn't work here.

share|improve this question
up vote 1 down vote accepted

If you are using the Python that comes with OS X, it was not built with Readline support at least in 10.8. You can still use basic Emacs-style keybindings:

  • control-A: go to beginning of line
  • control-E: go to end of line
  • option-B: go word backward
  • option-F: go word forward
  • control-K: delete to end of line
  • control-U: clear line
  • option-D: delete word forward
  • option-delete: delete word backward

If you installed Python with Homebrew, it was probably configured with Readline support, so you can use the same keybindings as in Bash.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .