Issue with Option+Arrow using tmux and emacs
Thanks for filing an issue! Please answer the questions below so I can help you.
- iTerm2 version:
3.4.0beta7 and above
- OS version:
- Attach ~/Library/Preferences/com.googlecode.iterm2.plist here (drag-drop from finder into this window)
- Attach a debug log, if possible. Instructions at https://iterm2.com/debuglog
- Attach a screen capture video if it would make the reproduction steps clearer.
- Are you reporting a performance issue, excessive CPU usage, or a hang? Please attach a sample. Instructions at https://gitlab.com/gnachman/iterm2/wikis/HowToSample
- Are you reporting a crash? Please attach the crash log. Instructions at https://gitlab.com/gnachman/iterm2/wikis/crash-logs
- Are you reporting excessive memory usage? Please attach a heap analysis: https://gitlab.com/gnachman/iterm2/wikis/heapshot
PLEASE ATTACH YOUR PLIST FILE FOR BUG REPORTS! Seriously! I'll probably ask you for it if you don’t.
Something changed between iTerm 3.4.0beta6 and 3.4.0beta7 that is breaking my workflow.
Specifically, emacs within tmux is no longer picking up Option+Arrow with my particular key mapping settings.
Shell: bash 3.2.57(1)-release (x86_64-apple-darwin19)
Tmux version: 3.1b (although the issue also occurs with older versions)
Detailed steps to reproduce the problem:
- In iTerm2, in Profiles -> Keys, set the Option keys to send "Esc+"
- Under "Key Mappings", remove the default "Option-Left" and "Option-Right" actions.
- Download Emacs for Mac OS X version 27.1-1 (emacsformacosx.com) and mount the disk image
- Install tmux via homebrew
- Launch tmux
- Launch the emacs executable using the -nw option (I used /Volumes/Emacs/Emacs.app/Contents/MacOS/Emacs -nw)
- Use the keyboard shortcut "C-h k" to ask emacs to describe its input
- Enter Option-Left
(Result in iTerm 3.4.0beta7 and up:)
<left> runs the command left-char (found in global-map), which is an interactive compiled Lisp function in ‘bindings.el’. It is bound to <left>.
What should have happened:
(Result in iTerm 3.4.0beta6 and below:)
<M-left> runs the command left-word (found in global-map), which is an interactive compiled Lisp function in ‘bindings.el’. It is bound to <C-left>, <M-left>.