views:

126

answers:

2

Actually gnome-terminal display tabs as 8 spaces, and this is very annoying when you cat files or view diffs, is there some way to change this permanently?

+2  A: 

You need to set the tabwidth on the underlying tty, not in gnome-terminal itself.

Theoretically, you should be able to use 'setterm -regtabs 4' to set the tabwidth to 4 in your .bashrc.

Doesn't seem to be working on my linux distro, but it works when I ssh from a remote system.

The easiest way to reset the tabwidth to 8 is to use 'tabs -8' (tabs -d8 to get a visual of the change).

Petesh
Setterm only works in TTY, so I apply 'tabs', see the next answer. (I do not know it before, so thanks ;D )
mkotechno
+1  A: 

The unique solution I found is to type in terminal:

tabs 5,9,13,17,21,25,29,33,37,41

and append it to ~/.bashrc if you want permanent changes.

PS: This obviously cover up to 10 tab indents.

mkotechno