tmux detects UTF-8 from the environment (see the manual), that must not be set up by your shell properly when you attach like this.
Add -u to the attach as well. On Fri, Jan 11, 2019 at 09:17:39PM +1100, Frederick Zhang wrote: > Hi guys, > > I know this may not be the best place to post this issue but I've been > experiencing a really weird problem with tmux under ArchLinux and so far > I've got absolutely no clue after plenty of research. So hope you guys can > shed some light on me. > > To create new/attach to existing tmux sessions automatically, I've got the > following configurations in my ssh_config: > > Match originalhost MyHost exec "[[ $(ps h o args p $PPID | wc -w) -eq 2 > ]]" > RemoteCommand tmux has-session && tmux attach || tmux -u > RequestTTY yes > Host MyHost > PreferredAuthentications publickey,password > > This works perfectly for my Debian/Ubuntu servers, but when I try to > connect to my Raspberry Pi, which runs ArchLinuxARM: > > 1. If there's no tmux running, ssh MyHost starts a new session and > everything looks good > 2. If there's already a tmux session, ssh MyHost attaches to the existing > session, but all special UTF-8 characters are shown as underscores, > e.g. the small box and arrows in my status bar, CJK characters > 3. If I comment out the Match section in ssh_config and manually run tmux > has-session && tmux attach || tmux -u after connected, UTF-8 always > works > > Both the packages in ArchLinux and Debian/Ubuntu are configured with only > --enable-utempter. The Arch one is 2.8 and the Debian one is 2.6 with one > Debian-specific patch. Trying to eliminate the differences, I built and > installed tmux 2.6 in my Pi but it didn't help. The symptom remained as it > was. > > I'm using exactly the same tmux configurations across all my servers, > which are from https://github.com/gpakosz/.tmux with a few minor > customisations. And yes, I'm using a UTF-8 locale: > > $ locale -a > C > en_AU.utf8 > en_GB.utf8 > en_US.utf8 > POSIX > $ cat /etc/locale.conf > LANG=en_US.UTF-8 > > I guess this is somehow related to TTY but after several hours of googling > and throwing it to forums, I still haven't got a single idea on how to > resolve it. So it'd be great if you guys can help me out. Thanks a ton! > > -- > Best Regards, > Frederick Zhang > > -- > You received this message because you are subscribed to the Google Groups > "tmux-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to tmux-users+unsubscr...@googlegroups.com. > To post to this group, send email to tmux-users@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "tmux-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to tmux-users+unsubscr...@googlegroups.com. To post to this group, send an email to tmux-users@googlegroups.com. For more options, visit https://groups.google.com/d/optout.