Warp
Warp copied to clipboard
In emacs, M-backspace sends M-b "ackspace"
Discord username (optional)
No response
Describe the bug
Running emacs -nw (version 28.2) and hitting META-backspace (using option key with "option as meta" turned on), the cursor goes back one word and then "ackspace" is inserted into the buffer.
Typing "C-h k M-backspace" (describe-key) shows that what is being sent is M-b (backward-word) and then the string "ackspace". Similar for M-enter, it sends M-e nter (forward-sentence then "nter").
To Reproduce
- In Settings/Features, turn on both Left Option key is Meta and Right Option Key is Meta.
- Run emacs -nw
- Switch to the scratch buffer.
- Type META-backspace. The cursor will jump back one word and "ackspace" will be inserted.
Expected behaviour
The previous word should be deleted (i.e., META-backspace should be sent).
Screenshots
No response
Operating System
MacOS
OS Version
12.6
Shell Version
zsh 5.8.1
Warp Version
v0.2022.09.13.08.15.stable_03
Additional context
No response
Does this block you from using Warp daily?
Yes
Warp Internal (ignore): linear-label:b8107fdf-ba31-488d-b103-d271c89cac3e
No response
Hey @jinschoi, thanks for reporting. I was able to repro this. We'll look into this!
Hi, do you have any updates on this? This is pretty annoying for me and I imagine several dozen other emacs users as well.
This isn't limited to emacs. Whenever Warp is in alternate screen, it sends this amusing and bizarro sequence.
This script enters alternate screen, and then I used a couple of arrow keys, hit backspace (which shows as ^?), mashed the keys a bit and finally hit Option+Backspace, and you can see it then send ESC "backspace" (ESC+b is Meta-b, and ESC shows as "^[")
Emacs keybindings entered widespread use through GNU ReadLine and their default availability in GNU bash and other applications that adopted ReadLine or implemented Emacs bindings, which generally do not interfere/conflict with common standard Windows/MacOS edit keys. As a result, many sequences have found their way into other applications, sometimes in a misconceived way.
The one I miss most is ^_
, 0x1F or Ctrl+Shift+Minus on US keyboards, which is Undo in Emacs (and by extension Bash). That sequence doesn't send anything in Warp. This seems like an oversight/omission, too; and you know, you can look at the lower parts of the ASCII table:
@ABCDEFGHIJKLMNO
PQRSTUVWXYZ[\]^_
The escape code when you hit Control + the Letter is the same code but minus 0x40. The ones that aren't letters might involve Shift as well, but they all work. Emacs uses ^@ for "Set Mark" (starting a selection region at the current point, like you'd do with a mouse) and ^_ for Undo.
I've noticed that ^K is quite common now, and ^U as well, though I wish people would not make ^U kill the whole line: in bash, it kills to the start of line only, and leaves everything after the cursor as it was.
If you use bind -P | less
in bash
, you can see even more keystroke bindings you might not know about. I've blown people's minds before using features like Undo, Cut and Paste (including cycling through the "kill ring" with M-y) or Reverse Searching with ^R: in the humble bash terminal, but these bindings all come from Emacs.
Anyway, hope this helps and I'm happy to give feedback/testing if you want to sent me a branch build or something.
Also seeing this in tmux (unsurprisingly given the above), can we please get an update on this?
Hey all, thanks for your patience -- I'll start looking into a fix for this
+1, in tmux
Hey all, we merged a fix for this a couple releases ago -- is the issue resolved on your end?
The one I miss most is
^_
, 0x1F or Ctrl+Shift+Minus on US keyboards, which is Undo in Emacs (and by extension Bash). That sequence doesn't send anything in Warp. This seems like an oversight/omission, too; and you know, you can look at the lower parts of the ASCII table:
I got a similar issue, when I use option+e in emacs, it prints out ´ instead of jumping to the end of the paragraph, I turned on "left option and right option as meta key" in warp
@JackYansongLi mind filing a separate issue? Sounds like the cause might be slightly different.
I'm going to close this one since the fix seems to have worked (at least, to stop sending that bizarre M-b 'ackspace' sequence