LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-21-2010, 09:12 PM   #1
wesbarris
LQ Newbie
 
Registered: Mar 2009
Distribution: CentOS
Posts: 9

Rep: Reputation: 0
Line wrap in less not working


I am having a problem with long lines when displayed in less.
It is difficult to describe but I will try...

I have a text file with some lines longer that 80 characters.
If I use less to view this file in an Putty terminal set to
an 80 character width, some of the lines wrap. So far so good.
If I now use the 'j' or 'arrow down' key to scroll down one
line at a time all is ok until I encounter another long line
(longer than 80 characters in my example). What I see is
only the wrapped portion of the line. The first 80 characters
are missing. At this point I can type a ctrl-L to refresh
the window and then the long line is wrapped properly. It is
only when I am scrolling one line at a time that I see this
behavior.

I am not certain that this is a "less problem". However, I only
notice it using less. vi works properly. more works properly.
I suppose it could also be a Putty, bash or environment problem
but I'm not sure.

I've played around with options to less such as -X -r -R without
any luck. The systems I am connecting to area all running CentOS
if that makes any difference.

Does anyone have any ideas?
 
Old 01-22-2010, 01:50 PM   #2
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
It sounds like a minor term inconsistancy, what do you get when you echo $TERM
 
Old 01-24-2010, 04:45 PM   #3
wesbarris
LQ Newbie
 
Registered: Mar 2009
Distribution: CentOS
Posts: 9

Original Poster
Rep: Reputation: 0
wes@biodev> echo $TERM
xterm

Since you asked, I also tried setting TERM to 'vt100' and 'ansi'.
In both cases I see the same (incorrect) behavior as I do with
'xterm'.

I am using Putty. Putty is not really an xterm but is seems like
'xterm' is a commonly used by others using Putty.
 
Old 01-24-2010, 09:08 PM   #4
jonjgc
LQ Newbie
 
Registered: Nov 2009
Posts: 17

Rep: Reputation: 6
My Linux and Solaris systems have terminfo definitions for 'putty'.
Why not try a TERM setting for that. Don't forget to export TERM.
 
Old 01-24-2010, 11:11 PM   #5
wesbarris
LQ Newbie
 
Registered: Mar 2009
Distribution: CentOS
Posts: 9

Original Poster
Rep: Reputation: 0
I just tried:

export TERM=putty

I get the same behavior. Perhaps this is not a TERM problem???
 
Old 01-28-2010, 08:49 PM   #6
wesbarris
LQ Newbie
 
Registered: Mar 2009
Distribution: CentOS
Posts: 9

Original Poster
Rep: Reputation: 0
I have solved the problem with less. For those of you following along it turned out to be a bug in the latest CentOS version of less. Here is the thread from the CentOS forum:

https://www.centos.org/modules/newbb...forumpost89507
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
line wrap not working with Debian arthus Linux - General 1 12-17-2007 10:46 AM
"enscript --word-wrap" does not wrap line of text file powah Linux - General 3 05-16-2006 09:12 PM
is it possible to do this in VIM with line wrap on? hedpe Linux - Software 5 04-19-2006 06:19 PM
xterms wrap over the same line when typing! humbletech99 Linux - Software 6 12-30-2005 05:58 PM
VI wrap line Ephracis Linux - Newbie 4 11-17-2005 05:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration