LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-22-2006, 07:54 AM   #1
Iskendar
Member
 
Registered: Jul 2003
Posts: 30

Rep: Reputation: 15
Less not working in terminal window


Hi all,


My problem is this: 'less' doesn't function properly when executed in
any X terminal application. I tried konsole, gnome-terminal and xterm,
all with the same result: a blank window with two lines at the bottom:

Code:
ESC]2;myname@mymachine:/home/myname/^GESC]1;mymachine^G
  textfilename (END)
When I log into a non-X session however, less works just fine. 'More'
and 'nano' work without problems as well, X-terminal or not. Any idea
on what might cause this?

Last edited by Iskendar; 01-17-2007 at 07:24 AM.
 
Old 12-22-2006, 03:56 PM   #2
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,137
Blog Entries: 6

Rep: Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826
http://linuxcommand.org/man_pages/less1.html

Post how you are trying to run less. Maybee Syntax prob?

I assume you mean less functions while CLI but not in Xterm in X?
 
Old 12-22-2006, 04:11 PM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by teckk
http://linuxcommand.org/man_pages/less1.html
Post how you are trying to run less. Maybee Syntax prob?
And on what kind of file?......eg do less and more behave differently when encountering binary files?
 
Old 01-17-2007, 07:19 AM   #4
Iskendar
Member
 
Registered: Jul 2003
Posts: 30

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by teckk
http://linuxcommand.org/man_pages/less1.html

Post how you are trying to run less. Maybee Syntax prob?
Code:
less textfile.txt
Don't see how I could get syntax problems with that. The behaviour is the same whether I'm
running in tcsh or in bash, by the way.

Quote:
Originally Posted by teckk
I assume you mean less functions while CLI but not in Xterm in X?
Yes.
 
Old 01-17-2007, 07:22 AM   #5
Iskendar
Member
 
Registered: Jul 2003
Posts: 30

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by pixellany
And on what kind of file?......eg do less and more behave differently when encountering binary files?
On plain ascii text files. Less outputs the same 2 lines as it does with a text file (with
the binary's filename substituted of course), whereas more behaves as expected: some characters
and a lot of empty space. In other words, again more works, less doesn't.
I am used to using less by the way, have done so for years, it's not as if it's rocket science.
It's just that on this pc, with this setup,it doesn't work when running in an xterm.

Last edited by Iskendar; 01-17-2007 at 07:27 AM.
 
Old 01-17-2007, 07:39 AM   #6
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
This probably has something to do with your X server and locale settings. I'm not proficient in this particular area, all I can tell you is I've encountered similar problems after switching to UTF-8. I use a source based distro so I was able to solve my problems by re-configuring and re-compiling offending programs.
 
Old 02-16-2007, 06:26 AM   #7
Iskendar
Member
 
Registered: Jul 2003
Posts: 30

Original Poster
Rep: Reputation: 15
Ok, found out some more: the origin of the error is located in .tcshrc (yes, we use tcsh).
It's in this piece of code:

Code:
 
 if ( $term == "xterm" ) then 
          rs
          rs
          alias cwdcmd 'echo -n "\033]2;${USER}@${HOST}:$cwd\007\033]1;${HOST}\007"'
          cwdcmd
 else
          unalias cwdcmd
 endif
with "rs" an alias for "eval `resize`". It puts "myname@myhost:/home/myhome" in the terminal header,
and is obviously responsible for the weird error message when running less. What I don't get is why
cwdcmd is run at all when less is opened, does less behave like an xterm session for some odd reason?
I'd think cwdcmd would be run once, when the xterm is started, and that's it. Weird.

Commenting out this bit solves the problem, frankly I don't get the use of this code anyway (though
the header bit is neat to have). I'll probably be switching to bash anyway, much easier for scripting.
Thanks for the help all (here and at fedoraforum).
 
  


Reply

Tags
less, tcsh



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
X Output to Terminal Window? PantherX Linux - Software 2 10-12-2006 12:09 PM
terminal in the root window phil.d.g Linux - General 17 04-09-2005 04:00 AM
terminal window on startup? zeviddalop Linux - General 4 09-21-2004 02:38 PM
Gnome Terminal Window Luis Rosso Linux - General 1 05-23-2004 02:43 PM
A permanent terminal window? flamesrock Linux - Software 2 10-09-2003 02:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:54 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