Enable Alt Key in Xterm

Normally, if you try the key sequence Alt+1 in xterm, it will output a special character. To enable the Alt key:

Add the following to the .inputrc file in your home directory. Create one if it doesn’t exist already.

set meta-flag on
set convert-meta off
set output-meta on

Add the following to the .Xdefaults file in your home directory.

XTerm*metaSendsEscape: true
XTerm*eightBitInput: false

Open xterm if its not already, and execute the following command in the xterm Window.

xrdb -load ~/.Xdefaults

Restart all xterm windows. The Alt key should work now.

About Pratik Sinha

Linux Nerd, Socialist, Atheist, Adventuristic, Nature Lover, Geeky.

2 comments

  1. Works like a charm, though I would suggest reloading the terminal settings with -merge so that previous custom settings are saved:

    xrdb -merge ~/.Xresources

Leave a Reply to Sridhar Sarnobat Cancel reply