Tuesday 8 May 2012

Tmux Displaying Split Borders as Dashes in OSX Lion

When I installed tmux on my main work machine iTerm was displaying the split pane borders in what appeared to be dashes as below.

Tmux displaying borders with dashes - or so I thought

At first this wasn’t too annoying, it was just a visual thing, but when switching from one pane to the next the pane border would merge into multiple lines and it looked very messy.

Tmux 7 iTerm with messy dashed borders

I scoured Stackover Flow as I normally do and started hunting and debugging. I started with my own bulletproof troubleshooting technique. It was only happening in iTerm, Terminal.app was displaying everything fine and it was only happening under my login. Other accounts were fine. I decided to try and nuke my iTerm preferences so I ended up reading the iTerm FAQ page. Below the answer that I was looking for I noticed this question …

Q: Some characters appear to be twice as wide as others, and things aren’t lining up correctly.


A: Go to Preferences->Profiles->Text and change the setting of "Treat ambiguous-width characters as double-width."

iTerm setting to solved the problem of dashes in tmux

Bingo. Unchecking the “Treat ambiguous-width characters as double-width.” setting did the trick

iTerm displaying borders correctly

I can’t be sure, but I suspect that tmux wasn’t using dashes, but was using the correct character. The problem was that iTerm belived this character to be ambiguous. After unchecking the box I was rewarded with my bounty.