xterm not wrapping text properly
Posted
by
mulllhausen
on Super User
See other posts from Super User
or by mulllhausen
Published on 2013-09-30T14:02:53Z
Indexed on
2013/11/04
3:59 UTC
Read the original article
Hit count: 544
I'm configuring both my gnome-terminal and xterm columns (i still haven't picked which of these I will be using) and I have a couple of issues I would like to fix:
- the typing area seems to be smaller (fewer columns) than the display area
- the typed text is not wrapping to the next line when it reaches the end - it just continues back around on the same line, overwriting the prompt
(i have set a custom bash prompt with PS1 in case this is relevant)
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 7.1 (wheezy)
Release: 7.1
Codename: wheezy
$ echo $TERM
xterm
$ stty -a
[peter@pc ~] $ stty -a
speed 38400 baud; rows 52; columns 126; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = M-^?; eol2 = M-^?; swtch = M-^?; 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 echoctl echoke
$[peter@mine ~] $ # the column width only goes up to here ------------------------------------------------>
the results are identical in both the xterm and in gnome-terminal 3.4.1.1
and as you can see, the output of the stty -a
command goes right up to the edge of the screen, while the typing does not go that far.
I have found that I can get the desired result by setting the columns to a very large number, eg:
$ stty cols 1800
this fixes both problems. Is it the right way to go about solving this problem? Will this "break" any of the output from programs? So far I have tried top
and stty -a
and these seem OK.
more info as requested in the comments
i found that if i cat
some input into a file then the columns actually strech the full width of the terminal window:
[peter@mine applications] $ cat > /tmp/asd
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasssssssssssssssssssssssssssssssssssssssssssssssssssssssssssqqqqqqqqqqqqqqqq
qqqq
does this imply that it is actually bash that is restricting the number of columns and not the terminal? if so then how to alter the number of columns in bash?
© Super User or respective owner