Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.