A question about the default tabstop in bash being 8.
The default tabstop in bash is 8. Is there a good reason for this? If not, how do you change it?
|
I just Googled and found one thread which rambled on about why you should not change it, but never talked about how TO change it. Pretty soon they were talking about how missionaries tried to change Bulgarian grammar. Now I have a headache......
Perhaps it is in the PS1 env. variable? Why can't I do "man PS1" on my machine? ARRRRRRRRRRRGH!! |
|
I guess the origins of tab stops every 8 characters are in typewriters and thence in teletypes which were the commonest terminal in the early days of UNIX. Neither typewriters not teletypes had standardised tab stop positions but 8 was chosen as the commonest value.
Bash itself does not define the tabstop spacing; do you mean the terminal's tabstop spacing? There's some relevant info here. |
That's what I meant, the terminal. I don't really know.
Quote:
I would assume it's the programs themselves that are doing it, I guess. I thought maybe it's altered in some way by something. I looked at that site, and it said "If your terminal has tabstops, etc." like I just quoted. The cat output was changed when the tabstop setting was different. I looked at the thread you posted the link to here, and used the setterm -regtabs 4 and it didn't change my cat output. The tabstops are still 8. |
Quote:
|
I read it, it's just one of those questions where everyone's answer for it differs, and using their suggestions doesn't appear to work. I assumed that maybe it wouldn't be possible, since it would be the program doing it, and not bash or the terminal. I tried a couple of things that people suggested, and it wouldn't work. I wouldn't really mark this as solved, since I still don't see how you could do it really ... but I guess it's not too big of a deal.
|
What sort of terminal are you using? According to the setterm man page, -regtabs (an its other tab controls) only work on virtual terminals.
That makes sense; only when the terminal device is controlled by Linux itself can it control the tab stops. For other terminal types -- hardware (!) and hardware emulators including terminals in graphical windows -- then it's the device itself that has to be configured. How to do that is dependent on the device itself. What sort of terminal are you using? |
On this page, it says that if the tabstop is changed, the tabs using cat will be changed:
http://hell.org.ua/Docs/oreilly/unix/upt/ch41_04.htm That's the web page you gave for information. --- I'm using gnome-terminal. Code:
joebuffer@ubuntu:~$ tty |
The tabstops set in vi only control how vi displays them; it doesn't affect the saved file which simply contains tabs. regtabs only controls virtual terminals. I believe those are the ones you get using Ctrl+Alt+F[1-6] so does not include gnome-terminal.
Did you try the tabs command as suggested here? Another avenue to try is termcap. gnome-terminal settings are affected by the termcap settings in /usr/share/vte/termcap/xterm. I think hts is used to define tabstops ... |
Thanks for your help, I'm sure this is all the information I need. I'm gonna mark this as solved, because I have the information I personally needed, but I haven't done this. I haven't gotten it to work yet, but I know this is all the information I really needed to help me solve this problem. I just wanted to be pointed in the right direction at least, and have a yes/no answer as to whether or not it could or should be done.
|
All times are GMT -5. The time now is 01:13 AM. |