Re-attaching an existing integrated tmux session with multiple windows breaks UTF-8
Thanks for filing an issue! Please answer the questions below so I can help you.
- iTerm2 version: 3.0.14
- OS version: macOS Sierra 10.12.3
- 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
- Are you reporting a performance issue 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
Detailed steps to reproduce the problem:
- Set iTerm2 settings to use UTF-8 locale (that is, use default setting)
- Set macOS locale to UTF-8 (that is, use default setting)
- Log on to a Linux computer
- Make sure that the Linux locale is UTF-8 (in my case, LANG=en_US.UTF-8 and LC_CTYPE=en_US.UTF-8)
- Start a new tmux session with "tmux -CC"
- Open a new tmux tab with Command+T
- Detach from the tmux session (by closing the iTerm2 window)
- Re-attach to the tmux session with "tmux -CC a"
- Type a non-ascii character, for example <U+00F8>, "ø"
What happened: In step 9, iTerm sends a ISO Latin 1 ø (a single byte 0xf8).
What should have happened: iTerm should have sent a UTF-8 ø (two bytes 0xc3+0xb8).
This only seems to happen on re-attaching an existing tmux session, not the first time you start it. It also only seems to happen when the session you re-attach have 2 windows or more. (If you detach between step 5 and 6 above, then re-attach and get a single tmux tab, iTerm sends UTF-8 correctly on my mac.)