• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1672
  • Last Modified:

Improper line wrapping at command prompt

Situation:
Windows XP desktop, putty SSH client, linux server.

When I connect to this (and some other) linux servers via putty, and am typing at the command prompt, my terminal wraps improperly.  Definetly for this particular server, it consistently wraps 18 characters before the edge of the screen.  But worse than wrapping, it actually simply starts over again at the beginning of the line.  So, i.e. my prompt starts out (where the underscore is my curor):

tony@wile live $ _

Then I start typing:

tony@wile live $ svn info includes/listing_class.inc | grep Re_

That's 62 characters of an 80 character wide terminal.  As I continue typing, I see:

vision_ile live $ svn info includes/listing_class.inc | grep Re

Very hard to explain, but see how the cursor wraps around to the beginning of the same line and starts overwriting?  The effect is much more severe when editing the middle of a very long line, things fly back and forth all over, and begin creeping up line by line on occasion.


There's surely a million things that could effect this and I'm at a loss to say what it might be.  Here's some starter info, if you need more don't hesitate to ask and I'll provide it.

Environment (selection):
BASH_VERSION='2.05b.0(1)-release'
COLUMNS=80
LINES=60
SHELL=/bin/bash
TERM=screen
TERMCAP=$'SC|screen|VT 100/ANSI X3.64 virtual terminal:\\\n\t:DO=\\E[%dB:LE=\\E[%dD:RI=\\E[%dC:UP=\\E[%dA:bs:bt=\\E[Z:\\\n\t:cd=\\E[J:ce=\\E[K:cl=\\E[H\\E[J:cm=\\E[%i%d;%dH:ct=\\E[3g:\\\n\t:do=^J:nd=\\E[C:pt:rc=\\E8:rs=\\Ec:sc=\\E7:st=\\EH:up=\\EM:\\\n\t:le=^H:bl=^G:cr=^M:it#8:ho=\\E[H:nw=\\EE:ta=^I:is=\\E)0:\\\n\t:li#60:co#80:am:xn:xv:LP:sr=\\EM:al=\\E[L:AL=\\E[%dL:\\\n\t:cs=\\E[%i%d;%dr:dl=\\E[M:DL=\\E[%dM:dc=\\E[P:DC=\\E[%dP:\\\n\t:im=\\E[4h:ei=\\E[4l:mi:IC=\\E[%d@:ks=\\E[?1h\\E=:\\\n\t:ke=\\E[?1l\\E>:vi=\\E[?25l:ve=\\E[34h\\E[?25h:vs=\\E[34l:\\\n\t:ti=\\E[?1049h:te=\\E[?1049l:us=\\E[4m:ue=\\E[24m:so=\\E[3m:\\\n\t:se=\\E[23m:mb=\\E[5m:md=\\E[1m:mr=\\E[7m:me=\\E[m:ms:\\\n\t:Co#8:pa#64:AF=\\E[3%dm:AB=\\E[4%dm:op=\\E[39;49m:AX:\\\n\t:vb=\\Eg:G0:as=\\E(0:ae=\\E(B:\\\n\t:ac=\\140\\140aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~..--++,,hhII00:\\\n\t:po=\\E[5i:pf=\\E[4i:Z0=\\E[?3h:Z1=\\E[?3l:k0=\\E[10~:\\\n\t:k1=\\EOP:k2=\\EOQ:k3=\\EOR:k4=\\EOS:k5=\\E[15~:k6=\\E[17~:\\\n\t:k7=\\E[18~:k8=\\E[19~:k9=\\E[20~:k;=\\E[21~:F1=\\E[23~:\\\n\t:F2=\\E[24~:F3=\\EO2P:F4=\\EO2Q:F5=\\EO2R:F6=\\EO2S:\\\n\t:F7=\\E[15;2~:F8=\\E[17;2~:F9=\\E[18;2~:FA=\\E[19;2~:kb=^H:\\\n\t:K2=\\EOE:kB=\\E[Z:*4=\\E[3;2~:*7=\\E[1;2F:#2=\\E[1;2H:\\\n\t:#3=\\E[2;2~:#4=\\E[1;2D:%c=\\E[6;2~:%e=\\E[5;2~:%i=\\E[1;2C:\\\n\t:kh=\\E[1~:@1=\\E[1~:kH=\\E[4~:@7=\\E[4~:kN=\\E[6~:kP=\\E[5~:\\\n\t:kI=\\E[2~:kD=\\E[3~:ku=\\EOA:kd=\\EOB:kr=\\EOC:kl=\\EOD:km:'

This particular linux installation is the Gentoo distribution if that helps.
0
arantius
Asked:
arantius
1 Solution
 
arantiusAuthor Commented:
Oops I already regret pasting in that termcap line.  Well, we can endure!
0
 
owensleftfootCommented:
Try unchecking the putty terminal option "auto wrap initially on" You could also try setting your TERM  to TERM=xterm - that is what putty emulates.
0
 
vmadhipatlaCommented:
i have putty in my windows XP laptop and i have fedora FC3 running in desktop. For me TERM=XTERM  and TERMCAP is blank. hope this helps.

venkat
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
arantiusAuthor Commented:
>  Try unchecking the putty terminal option "auto wrap initially on"

No effect

> try setting your TERM  to TERM=xterm

I run inside screen, so that setting is right.  Outside of screen, the TERM is xterm on its own, and the behavior is exactly the same.
0
 
arantiusAuthor Commented:
TERMCAP is also blank (nonexistant, actually) outside of screen.
0
 
Duncan RoeSoftware DeveloperCommented:
Try "stty -a" and see what width the terminal thinks it is. Look for "columns <number>" in the first line of o/p.
To change the value, type "stty columns <new value>"
Also you could try "set|grep COLUMNS"
Change by (jn bash) "COLUMNS=80" or whatever value you want.
I think most programs try for the stty setting first.
0
 
GnsCommented:
> I run inside screen, so that setting is right.  Outside of screen, the TERM is xterm on its own, and the behavior is exactly the same.
Almost certain that it'd be screen messing things up (and it would be simpler if it isn't:-).
Is the behaviour the same _before_ you've run screen, or only after... for the "ormal term" so to speak?
Also, stty -a listings from before screen, inside screen and after screen would pehrpas be of interrest.

-- Glenn
0
 
arantiusAuthor Commented:
Login, no screen (and yes, this behavior exists before ever running screen):

$ stty -a
speed 38400 baud; rows 60; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <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
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
$ set | grep TERM
TERM=xterm
$ screen
$ stty -a
speed 38400 baud; rows 60; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <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
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
$ set | grep TERM
TERM=screen
0
 
GnsCommented:
I've seen this typpe of thing, but then only when screen (some unnamed version best forgotten:-) has messed it up.
Hm, well scratch that idea then.

What version of PuTTY is this? If not 0.57, perhaps try with that (from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html of course)

What are the terminal&window settings in PuTTY for the session in question?

Oh, and this is bash/readline, so perhaps try temporarily disabling readline to see if that makes any difference. Might actually be all readline...

-- Glenn
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now