Leopard Terminal (and iTerm) ignores control key combinations

I am very used to using Ctrl + A , Ctrl + E , Ctrl + L , etc. as shortcuts for operations (beginning of line, end of line, clear terminal, etc.). I can’t work with Terminal.app or iTerm on OS 10.5 for life.

I know that it works in Tiger, and I even know some other Leopard users who have no problems, but when I try to use a control key, it just prints literal results (e.g. - ^A ) on 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?

+5
source share
3 answers
  • Make sure you have a file called ~ / .inputrc (if this file does not exist, bash should use / etc / inputrc for system init, but I always prefer to be explicit)
  • In this file, if you want voooo emacs disgusting bindings instead of sweet, clean vi:

    set -o emacs set emacs editing mode

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

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

    bind -p

on the command line to make sure you have the bindings that you think you have

  1. Finally, since it is OSX, check to see if you have a readline library (this is how you get it all.) Again, it should be there by default, but maybe it is not.

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

The fact that your installation works when you are in a different place means a local problem.

Good luck.

+6
source

Check vi mode (set -o) or vi editing mode or layout (bind -v). The default mode is emacs, but it can be set to vi, for example. in ~ / .bashrc (with the -o vi set) or ~ / .inputrc.

+2
source

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

I think you somehow did not get the ctrl key. You are not using a command or Alt key, right?

+1
source

Source: https://habr.com/ru/post/885928/


All Articles