Pasting with "Convert tabs to spaces" does not respect tabstops
I'm using iTerm2 version 3.0.0 on OS X 10.11.5.
I want to copy and paste this Linux session excerpt, converting the tabs to spaces while keeping the columns aligned:
$ du -s /usr/bin /usr/games /usr/lib /usr/local /usr/sbin
59740K /usr/bin
4K /usr/games
245116K /usr/lib
172K /usr/local
8476K /usr/sbin
du
from GNU coreutils formats its output with single tab characters, and that's how the columns are rendered by default.
If I select that in iTerm2 and paste it with "Convert tabs to spaces", choosing a tab size of 8 spaces, this is how iTerm2 renders it:
$ du -s /usr/bin /usr/games /usr/lib /usr/local /usr/sbin
59740K /usr/bin
4K /usr/games
245116K /usr/lib
172K /usr/local
8476K /usr/sbin
Each tab has been converted into exactly 8 spaces, so the textual columns have become misaligned.
What I expected was the behavior of the expand
GNU coreutils command, which converts tabs into the correct number of spaces so that the tabstops are respected.
iTerm2's behavior here seems broken to me, or at least not useful. I'm not sure if this is a bug or a feature request. I'm having trouble imagining a situation in which I would want tab characters to always be converted into exactly N spaces while disregarding tabstops.