Skip to content

Re-attaching an existing integrated tmux session with multiple windows breaks UTF-8

com.googlecode.iterm2.plist debuglog.txt

Thanks for filing an issue! Please answer the questions below so I can help you.

Detailed steps to reproduce the problem:

  1. Set iTerm2 settings to use UTF-8 locale (that is, use default setting)
  2. Set macOS locale to UTF-8 (that is, use default setting)
  3. Log on to a Linux computer
  4. Make sure that the Linux locale is UTF-8 (in my case, LANG=en_US.UTF-8 and LC_CTYPE=en_US.UTF-8)
  5. Start a new tmux session with "tmux -CC"
  6. Open a new tmux tab with Command+T
  7. Detach from the tmux session (by closing the iTerm2 window)
  8. Re-attach to the tmux session with "tmux -CC a"
  9. 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.)