I first asked this on Stack Exchange, but haven't received an answer or feedback that has helped me. So I posted it on Apple's forums Apple's forums and got some responses, which included a suggestion to post it here.
The short version is that I'm on Mavericks 10.9.2 and when I edit my keyboard for Terminal, 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:
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 would 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 on the new iMac 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. As best I can tell, I have everything in the Terminal Preferences on the new iMac set to what I have on the old iMac, but escape codes are not being processed.
I'm working with the same .bash_profile file in my user directory and I've copied over any other hidden files in the user directory on the old iMac to the new one. I've rebooted the old iMac, so I know my configuration there still works fine. I must have missed something that didn't get copied from the old one to the new iMac - or changed a setting without realizing it.
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."); */
}
The short version is that I'm on Mavericks 10.9.2 and when I edit my keyboard for Terminal, 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 would 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 on the new iMac 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. As best I can tell, I have everything in the Terminal Preferences on the new iMac set to what I have on the old iMac, but escape codes are not being processed.
I'm working with the same .bash_profile file in my user directory and I've copied over any other hidden files in the user directory on the old iMac to the new one. I've rebooted the old iMac, so I know my configuration there still works fine. I must have missed something that didn't get copied from the old one to the new iMac - or changed a setting without realizing it.
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."); */
}