![](https://seccdn.libravatar.org/avatar/24ca8608248a11f8eeb5fa02a0d5c463.jpg?s=120&d=mm&r=g)
Robert wrote regarding '[SLE] Setting console tab width' on Sat, Sep 11 at 14:48:
I like tabs to be displayed narrower than 8 spaces. Sometimes I cat or print files to stdout on a console. I thought setting terminal tab width would be pretty straightforward but I must be going about it the wrong way. I'm running SuSE 9.1 on an Athlon.
man tabs looked promising. However, although the documentation appears to have been installed by default, the command wasn't. I looked at stty, setterm, and tput. setterm's -regtabs option looked right. However, setterm -regtabs 4 has no effect, despite the fact that there is no error message and the return code indicates no error. Maybe tput will help tput it 8 tput it 4 8 except nothing happens.
Any suggestions on how to set the tab width? Ideally, I would like this to be command-based instead of termcap-based so it can easily be user-specific and machine independent.
It appears that you're having problems on a per-program basis. As a test, I used echo's '-e' option to print a tab char. Here's what I get: dsauer@danny-pc:~> setterm -regtabs 8 dsauer@danny-pc:~> echo -e 'moo\tmoo\nm\tmoo' moo moo m moo dsauer@danny-pc:~> setterm -regtabs 4 dsauer@danny-pc:~> echo -e 'moo\tmoo\nm\tmoo' moo moo m moo That's on a 9.1 workstation, but it works the same on a 7.1 system, so I'd expect it to work for you. It's limited to the terminal's output, though, and won't neccesarily work inside other programs that handle the terminal directly. So, if you fire up vim or even less, it won't work as well. It'll work through "more", though. You probably need to set your tabstops per application if you want something other than the huge 8 spaces commonly used. --Danny