?
Solved

Improper line wrapping at command prompt

Posted on 2005-03-23
9
Medium Priority
?
1,533 Views
Last Modified: 2012-06-22
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
Comment
Question by:arantius
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 18

Author Comment

by:arantius
ID: 13615253
Oops I already regret pasting in that termcap line.  Well, we can endure!
0
 
LVL 17

Expert Comment

by:owensleftfoot
ID: 13615392
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
 
LVL 1

Expert Comment

by:vmadhipatla
ID: 13615463
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
WordPress Tutorial 2: Terminology

An important part of learning any new piece of software is understanding the terminology it uses. Thankfully WordPress uses fairly simple names for everything that make it easy to start using the software.

 
LVL 18

Author Comment

by:arantius
ID: 13616020
>  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
 
LVL 18

Author Comment

by:arantius
ID: 13616034
TERMCAP is also blank (nonexistant, actually) outside of screen.
0
 
LVL 35

Expert Comment

by:Duncan Roe
ID: 13618574
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
 
LVL 20

Expert Comment

by:Gns
ID: 13619424
> 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
 
LVL 18

Author Comment

by:arantius
ID: 13622050
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
 
LVL 20

Accepted Solution

by:
Gns earned 2000 total points
ID: 13622804
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

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month10 days, 10 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question