As illustrated in the other answers, the
tabs utility is the simpler way to specify tab stops for applications (such as your shell) which do not set their own tab stops. POSIX specifies a
tabs utility, (as well as
tput), but has nothing to say about terminfo or the behavior of
tput for this purpose. (X/Open Curses, which is a separate standard, does have something to say).
But to use those tab stops, you should also ensure that your terminal is setup to use hardware tabs. If you do
stty -a, look for
tab0 in the output:
speed 38400 baud; rows 40; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
According to the
stty manual, you should be able to set
tab3. POSIX defines
tab2, but only
tab0 (hardware tabs) and
tab3 (software tabs) are useful to you.
Select tab expansion policy.
tab0 disables tab expansion, while
tab3 enables it.