LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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, 08: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 08:24 AM.
 
Old 12-22-2006, 04:56 PM   #2
teckk
Senior Member
 
Registered: Oct 2004
Distribution: FreeBSD Arch
Posts: 1,773

Rep: Reputation: 197Reputation: 197
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, 05:11 PM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729
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, 08: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, 08: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 08:27 AM.
 
Old 01-17-2007, 08:39 AM   #6
Emerson
Senior Member
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~
Posts: 3,177

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, 07: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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 01:09 PM
terminal in the root window phil.d.g Linux - General 17 04-09-2005 05:00 AM
terminal window on startup? zeviddalop Linux - General 4 09-21-2004 03:38 PM
Gnome Terminal Window Luis Rosso Linux - General 1 05-23-2004 03:43 PM
A permanent terminal window? flamesrock Linux - Software 2 10-09-2003 03:58 AM


All times are GMT -5. The time now is 03:43 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration