How do I insert a tab character in Iterm?

It's not iTerm, but your shell that affects how you''re able to insert a tab.

First, make sure you're in BASH shell: Type the following command:

$ echo $RANDOM $BASH_VERSINFO
23714 3

The first is a random number, and the second should be the BASH Version number. If you get a blank line or just a random number, you're not in the BASH shell, and that's probably one of your issues.

Another thing is to execute this command:

$ set -o
allexport       off
braceexpand     on
emacs           on
errexit         off
errtrace        off
[...]
privileged      off
verbose         off
vi              off
trace           off

The two lines of interest is the emacs and the vi lines. One of those should be on. If they're both off, you can't do the Ctrl-V-Tab to insert a tab character.

When the vi mode is on, it should be Ctrl-V-Tab like you said. With emacs mode on, it is either Ctrl-V-tab, or possibly Ctrl-Q-tab.

However, this isn't an iTerm thing, this is your shell that's doing it.


The answer was to hit control+v, then tab afterwards, not all together! Hope this helps someone.