1821584 Members
3739 Online
109633 Solutions
New Discussion юеВ

display 132 columns

 
SOLVED
Go to solution
peterchu
Super Advisor

display 132 columns

I have a problem to display the output on the screen , it only display the first 80 columns , then I try to set the colunms as 132
like below , I found that some of server can display 132 , but some of server is not work that only 80 can be display , could suggest what is the problem ? thx.

#export COLUMNS=132
# echo $COLUMNS
132
13 REPLIES 13
Mei Jiao
Respected Contributor

Re: display 132 columns

Peter,

Can you pls try to vi a textfile or view a textfile with more command on the server that doesn't work, like:
# vi
# cat | more
# echo $TERM
# echo $TERMINFO

Pls revert the output of the above. Thx.
Shaikh Imran
Honored Contributor

Re: display 132 columns

Hi,
I don't think you will be able to set the coloumn with this this commnad is for variable assigment.
You are assigning 132 ( number to a variable COLUMN.
You will achieve this by stty command.
stty -a will show you the current column set to 80 and you can change this temporarily by stty command ( see man stty )and permanently by putting the same command in /etc/profile.

Regards,




I'll sleep when i am dead.
Elmar P. Kolkman
Honored Contributor
Solution

Re: display 132 columns

Setting the environment variable works for some commands, like vi. But other commands have the nasty habit of doing things by themselves and just limit the columns to 80.

To start with, what kind of terminal (emulation) are you using. For instance, if you're using xterm, make sure your TERM setting is 'xterm', not vt100 which is sometimes automagically selected when logging in. Also, check the command you're using for it being by any chance a shell script that overrides your environment variable.

Also check your terminal size if it is capable of doing 132 colums. For instance, run the 'resize' command to see the if HP-UX is seeing your terminal and size correctly. If not, that might be the cause of your problem.

And last, mind that the HP commands, like sam and swinstall, are not able to use additional columns. If you want larger windows for them, use the X-windows version of them. (perhaps next time give more info on the command you have problems with)
Every problem has at least one solution. Only some solutions are harder to find.
peterchu
Super Advisor

Re: display 132 columns

thx replies,

I tried to use stty , but still can't , can suggest what is wrong ? thx.

#stty cols 132
#stty -a
speed 9600 baud; rows 24; columns 132; line = 0;
peterchu
Super Advisor

Re: display 132 columns

I use Netterm and vt220 .
Mei Jiao
Respected Contributor

Re: display 132 columns

I wonder if changing permissions of this file to 777 works, but you can try:
/usr/lib/terminfo/v/vt220

What do you see when you run 'resize' command?
# resize
peterchu
Super Advisor

Re: display 132 columns

thx Mei ,

I use stty to change to 132 columns ,
#stty cols 132
# stty -a
speed 9600 baud; rows 24; columns 132; line = 0;

but use your command resize , it still show 80 , can suggest what is my problem ? thx

#resize
COLUMNS=80;
LINES=24;
export COLUMNS LINES;
peterchu
Super Advisor

Re: display 132 columns

Hi all,

What I am wonder is some of servers is normal to view 132 colunms but some servers can't , could suggest what is wrong ? thx.
peterchu
Super Advisor

Re: display 132 columns

thx all ,

I found that some output can display 132 columns , eg. I type stty -a , then it output to 132 colunms , but if I type ps -ef |grep , then 80 colunms will output , what is the problem ?thx.
Bruno Ganino
Honored Contributor

Re: display 132 columns

Terminal Settings must be set to 8-bits (i.e. stty cs8 -parity -istrip, or any equivalent parameters).
For more information see "terminfo".
Bruno
Torino (Turin) +2H
Bill Hassell
Honored Contributor

Re: display 132 columns

Telling the shell to display 132 columns without changing your terminal (in this case, an emulator) will not do anything. In NetTerm, you must inform the emulator that you need 132 columns. Most modern terminal emulators have a choice for the character space (default is usually 24x80). The choice is to wrap lines that are too long at the right edge (character 81 goes onto the next line) or overwrite (character 81 replaces 80 ansd so on).

So forget about setting COLUMNS. NetTerm is a smart terminal emulator that uses the SIGWINCH capability in most modern Unix flavors. Just do this in your emulator:

-> Options -> Setup -> Desktop Settings

Then select the 132 button instead of the 80 button. Click on OK and the window will jump to 132 character width *and* COLUMNS in the shell will change automatically from 80 to 132. Run vi or display a wide format file and you'll see all the columns out to 132.

NOTE: NetTerm has an auto-save for it's configuration. If you exit from NetTerm, it will remember any changes you've made and will start up in the wide screen format again.


Bill Hassell, sysadmin
peterchu
Super Advisor

Re: display 132 columns

thx bill,

I set 132 col , use vi and some command is ok to display 132 , but if use "ps -ef |grep root" , it only display 80 col. can suggest what is problem ? thx

root 965 1 0 Jun16 ? 00:00:02 /usr/bin/perl /usr/libexec/webmi
root 970 1 0 Jun16 tty2 00:00:00 /sbin/mingetty tty2
Bill Hassell
Honored Contributor

Re: display 132 columns

ps does not have any concept of line length so you can see any length that ps writes to the screen, regardless of the setting for $COLUMNS. If your terminal is set for 80 characters, then characters beyond 80 will move to the next line or over-write column 80 depending on the setting for Autowrap (ptions -> Setup -> Desktop Settings...) which is located in the Line Control options.

Now if you are running Java or other applications that have massively long pasthnames or argument lists, ps has a standard limit of 60 characters for the command line. You can extend this with the -x option (as in ps -efx). If your version of ps reports an error with -x, you need the latest ps patch (sorry, none available for 10.20 or earlier).


Bill Hassell, sysadmin