Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

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.

[robg adds: As submitted, the hint contained the actual key sequence and instructions to copy and paste it into Terminal. However, between Geeklog submission and publication, something munged the string, so I had to remove it. Theoretically, you should be able to type Escape followed by [2~ and make this work. However, I created the sequence by editing the existing definition for F12 (double-click it), as it ends in 24~. In the edit box, there's a Delete One Character button, so I clicked the mouse to the right of the 4, then clicked the button to delete one character. However, I'm unsure about testing the functionality of this keystroke, as I rarely use X11 apps.]
    •    
  • Currently 3.10 / 5
  You rated: 3 / 5 (10 votes cast)
 
[24,870 views]  

Add an Insert key in Terminal and X11's xterm | 2 comments | Create New Account
Click here to return to the 'Add an Insert key in Terminal and X11's xterm' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Add an Insert key in Terminal and X11's xterm
Authored by: Chibby on Feb 22, '08 02:23:51AM

Isn't it much easier to push CTRL + --> (right arrow key)
Works in vim.. also in other apps?!



[ Reply to This | # ]
Add an Insert key in Terminal and X11's xterm
Authored by: Richmp on Jan 28, '11 08:08:58AM

This worked great for me. Thanks!
Rich
I am using uni-SPF which works great, but requires several old 3270 term type keys, I now need the Backtab esc sequence chars for the terminal.app

Edited on Jan 28, '11 08:25:30AM by Richmp



[ Reply to This | # ]