LinuxQuestions.org
Review your favorite Linux distribution.
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 08-30-2012, 11:40 PM   #1
hda7
Member
 
Registered: May 2009
Distribution: Debian wheezy
Posts: 252

Rep: Reputation: 31
Setting kde TERM variable at startup fails/is overwritten


I'm trying to set the TERM environmental variable to "linux" when KDE starts because less behaves weirdly with the default value of "xterm", for whatever reason (when quitting less, the console resets so you can't refer back to any text you were viewing. This even happens with "less -F", which renders that switch useless). I have a script ~/.kde/env/profile.sh with the following contents:
Code:
export TERM="linux" EDITOR="emacs-edit" VISUAL="emacs-edit"
EDITOR and VISUAL get set, but TERM is still "xterm" after starting KDE. Does KDE set TERM back to "xterm" after scripts in ~/.kde/env? If so, can it be overridden? If not, I suppose I could put it in ~/.bashrc or such, since I only need it for less.

Last edited by hda7; 08-30-2012 at 11:50 PM.
 
Old 08-31-2012, 12:00 AM   #2
hda7
Member
 
Registered: May 2009
Distribution: Debian wheezy
Posts: 252

Original Poster
Rep: Reputation: 31
I haven't solved the problem as such, but, as a workaround, I've put TERM=linux in konsole's profile environmental variables.
 
Old 08-31-2012, 06:42 PM   #3
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian + kde 4 / 5
Posts: 6,845

Rep: Reputation: 2006Reputation: 2006Reputation: 2006Reputation: 2006Reputation: 2006Reputation: 2006Reputation: 2006Reputation: 2006Reputation: 2006Reputation: 2006Reputation: 2006
I think you'd be better served to figure out what's making less do that, because I've never seen that behavior myself. Take a look at the environment settings that affect it and see if they include any options or settings that affect resetting the screen.

Removing "xterm" from the TERM variable could have consequences if any other program or script expects it to be there.
 
Old 08-31-2012, 11:38 PM   #4
hda7
Member
 
Registered: May 2009
Distribution: Debian wheezy
Posts: 252

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by David the H. View Post
I think you'd be better served to figure out what's making less do that, because I've never seen that behavior myself. Take a look at the environment settings that affect it and see if they include any options or settings that affect resetting the screen.

Removing "xterm" from the TERM variable could have consequences if any other program or script expects it to be there.
None of my currently set variables that less reads (except TERM) appear to have that affect, according to the manual page. I couldn't figure less' behavior out either, but I eventually found that setting TERM to "linux" fixes it, and I haven't had any other problems caused by that, so I will continue with the current solution until someone can clear my befuddlement at less' behavior and suggest another solution.
 
  


Reply


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
No value for $TERM variable Moiseshb Slackware 6 05-17-2010 10:11 PM
Use of TERM environment variable saandeep_jan Linux - Newbie 1 08-30-2007 04:55 PM
KDE startup as user fails... bobbens Linux - Software 4 11-15-2004 04:44 PM
$TERM Variable Problems LinuxTechie Red Hat 2 11-02-2003 11:29 AM
Setting PS1 variable for KDE Konsole shell (RH9) robertmarkbram Linux - Software 4 10-14-2003 08:38 PM

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

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