5

I am very used to using Ctrl + A, Ctrl + E, Ctrl + L, etc. as shortcuts to operations (beginning of line, end of line, clear terminal, etc). I cannot for the life of me get this working with either Terminal.app or iTerm on OS 10.5.

I know for a fact that it works in Tiger and I even know some other Leopard users who don't have any problems, but when I try to use control key it just prints the literal results (eg - ^A) to the screen.

My related environment variables:

TERM=linux (have also tried xterm-color)
SHELL=/bin/bash
COMMAND_MODE=unix2003 (have also tried legacy)

Any ideas?

Jasper
  • 2,166
  • 4
  • 30
  • 50
jerodsanto
  • 9,726
  • 8
  • 29
  • 23

3 Answers3

6
  1. Make sure you have a file called ~/.inputrc ( if this file does not exist bash should use /etc/inputrc for system wide init, but I always prefer to be explicit )
  2. In that file if you want the nauseating emacs voodoo bindings instead of sweet, clean vi:

    set -o emacs set editing-mode emacs

In the above, remember that emacs mode is the default, but you never get hurt by being explicit...

  1. Again, you said you were using bash, so run:

    bind -p

at the shell prompt to ensure that you have the bindings you think you have

  1. finally, since it's OSX, check to make sure you have the readline library ( which is how you get all this stuff.) Again, it should be there by default, but perhaps it is not.

  2. Check the TERM setting in the Terminal.app program ( Preferences > Advanced > Emulation )

The fact that your rig works when you ssh somewhere else means implies a local problem.

Good luck.

chiggsy
  • 8,153
  • 5
  • 33
  • 43
2

Check for vi mode (set -o) or a vi editing-mode or keymap (bind -v). The default mode is emacs, but it might be set to vi e.g. in ~/.bashrc (with set -o vi) or ~/.inputrc.

mark4o
  • 58,919
  • 18
  • 87
  • 102
1

My leopard works out of the box with ctrl+A etc...

I think you've somehow got the ctrl key mismapped. You're not using the command, or alt key, right?

Adam Nelson
  • 7,932
  • 11
  • 44
  • 64
  • correct, I am not using command or alt. Also, if I ssh to a linux box my ctrl+ shortcuts work as expected. Very strange, and I can't seem to fix it. – jerodsanto Jun 05 '09 at 19:34