Add an Insert key in Terminal and X11’s xterm UNIX

I need an insert key to work with my company’s custom software, not to mention all the little annoying little Unix programs that expect a INS key. With X11 apps, its easy to use xmodmap f12 to temporarily emulate an insert key. Just type the following in xterm:

xmodmap -e "keycode 119 = Insert"

Now the F12 key acts like insert in all X11 apps, as long as you run them from the terminal. The best part is that keyboard settings go back to normal as soon as you close the Terminal, so you don’t have to worry about changing it back. That’s all well and good, but I prefer to use the Mac’s Terminal.app when possible. Fortunately it’s pretty easy to emulate an INS key there, too. In Terminal.app’s Preferences, go to Settings and select Keyboard. Find the Key you want to replace — in my case, F12 — and change the default Action value to:

\033[2~

Note that the \033 is the Escape key, not those literal characters. I haven’t been able to find a way to easily revert the setting, but I don’t tend to need the F12 key in the Terminal, so I just leave it.




coded by nessus