Why Doesn't Terminal Doesn't Handle Escape Codes?
The short version is that I'm on Mavericks 10.9.2 and when I edit my keyboard, anything after \033[ and a digit is treated as text, indicating the \033[ is not being read as an escape code. I want to edit some of the cursor movement keys (mainly home, end, and forward delete) and I've put in the proper escape codes, but none of them work. as of now I have:
- Home: \033[1~
- End: \033[4~
- Delete (forward): \033[3~
They will not work. In each case, when I use any of these three keys, I get a tilde (~) printed on the console, but no action at all. (I have the same issue with anything other keys, including pre-set ones, that use escape codes in Terminal.)
I have the terminal set to emulate a VT102.
I just like to get the escape sequences working on the Terminal.
--------------------------------------------
Background:
I just upgraded from an iMac from 2007/2008 (bought it refurbished in 2009). The older iMac had been upgraded to 10.9.1. Migration Assistant would not work and did not copy any files - but sat there and claimed to be working. So I set up my account and re-created ~/Library/KeyBindings/DefaultKeyBinding.dict (included at the end of this post) and I copied over ~/Library/Saved Application State/com.apple.Terminal from the old iMac to the new one. I tried to find any folders in ~/Library/Application Support, but there was nothing there.
This was working fine on my old iMac under 10.9.1, but never once worked on my new one, on 10.9.1 or 10.9.2
Here is my DefaultKeyBinding.dict:
{
/* Remap Home / End keys to be correct */
"\UF729" = moveToBeginningOfLine:; /* Home */
"\UF72B" = moveToEndOfLine:; /* End */
"$\UF729" = moveToBeginningOfLineAndModifySelection:; /* Shift + Home */
"$\UF72B" = moveToEndOfLineAndModifySelection:; /* Shift + End */
"@\UF729" = moveToBeginningOfDocument:; /* Cmd + Home */
"@\UF72B" = moveToEndOfDocument:; /* Cmd + End */
"$@\UF729" = moveToBeginningOfDocumentAndModifySelection:; /* Shift + Cmd + Home */
"$@\UF72B" = moveToEndOfDocumentAndModifySelection:; /* Shift + Cmd + End */
/* "\UF739" = (insertText:, "Testing text to see if anything works."); */
}
iMac (27-inch, Late 2013), OS X Mavericks (10.9.2)