sending escape sequences is broken, at least for page up / pgup / pageup in emacs
By cpi... on February 09, 2012 06:17 (imported from Google Code)
What steps will reproduce the problem?
- iTerm->Preferences->Keys
- Create shortcut binding Page Up to Send Escape Sequence [5~
- emacs -nw
- hold enter to create more than one window of newlines
- press Page Up
What is the expected output? What do you see instead?
Expected: emacs buffer scrolls up one page
Instead: ~
What version of the product are you using? On what operating system?
Build 1.0.0.20120203 on 10.6.8
Please provide any additional information below.
Using Send Text Sequence "^[[5~" just spits that into emacs, obviously that isn't the answer. My Terminal.app settings bind Page Up to "\033[5~" and they work just fine. \033 is ASCII octal for ESC, which is also generated with Ctrl-[, i.e. ^[, so it really is the right sequence. Converting everything to hex, I get 1B5B357E, and this still doesn't work if I use Send Hex Code. Putting spaces between the hex codes (1B 5B 35 7E) doesn't work either.
If I try manually hitting "ESC[5~" or "Ctrl-[[5~", emacs tells me that "M-[ 5" is undefined before I type the ~. However, both of these work in Terminal.app.
Finally, a similar version of this bug was closed as WontFix in https://code.google.com/p/iterm2/issues/detail?id=1407 #1407 (closed) Bug 1407 Issue #1407 (closed) (not sure if google autolinks bugs, testing this...). The solution given was to create these bindings:
Shift + Up Arrow: Send ^[[5~
Shift + Down Arrow: Send ^[[6~
Well, I've obviously tried that, and I think the manual attempts from within emacs that work in Terminal.app demonstrate a legitimate problem. The only other place where Esc appears in the settings is in the profile section, and changing Option to Normal or Meta instead of +Esc has no effect.