Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've just upgraded from 11.04 to 11.10. So far I love it, everything seems just so much snappier.

Now I just have one minor issue. When I try to suspend my laptop, it doesn't work - instead it fades out the screen, blocks it and then instantly wakes back.

I've checked the logs in /var/log/pm-suspend.log and this fragment seems relevant:

/usr/lib/pm-utils/sleep.d/000kernel-change suspend suspend: success.
Running hook /usr/lib/pm-utils/sleep.d/00clear suspend suspend:
TERM environment variable not set.

/usr/lib/pm-utils/sleep.d/00clear suspend suspend: Returned exit code 1.
Sat Nov 19 12:23:20 CET 2011: Inhibit found, will not perform suspend
Sat Nov 19 12:23:20 CET 2011: Running hooks for resume

The mentioned script at /usr/lib/pm-utils/sleep.d/00clear reads:

#!/bin/bash
clear

When I open a terminal anywhere by hand, $TERM is set to either "linux" or "xterm". However somehow when the 00clear command is executed $TERM is set to "dumb".

Two questions:

  • What is the correct value for $TERM when running 00clear script?
  • Where can I set it up?

I've looked for solutions on the web, however I could only find information on how to configure $TERM in a regular terminal (and this one is set properly).

share|improve this question
    
Have you tried commenting the clear? –  enzotib Nov 19 '11 at 13:31
    
@enzotib Yea, I guess that would work - it just wouldn't clear the console while going to sleep. However I still would like to know how to do it properly. I wouldn't like to find the same problem in a number of places. –  julkiewicz Nov 19 '11 at 16:02

1 Answer 1

up vote 2 down vote accepted

You could put your TERM setting in a tiny script fragment in /etc/profile.d/setTERM:

# Set TERM to something reasonable  
TERM=<whatever>  
export TERM  

for <whatever>, reading man clear should have led you to man terminfo, which shows you how to pick a terminal type.

Set TERM to one of the filenames in /usr/share/terminfo/*/*, so clear will be able to look up a sequence of characters to output to "clear the screen".

It is worrying if /usr/share/terminfo is empty.

My system shows:

walt@wombat:~(0)$ dpkg -S /usr/share/terminfo  
ncurses-term, ncurses-bin: /usr/share/terminfo  
walt@wombat:~(0)$ apt-cache search ncurses-term\|ncurses-bin  
ncurses-bin - terminal-related programs and man pages  
ncurses-term - additional terminal type definitions  

I think that one or both of these packages are needed for clear to be happy.

share|improve this answer
    
Is it worrying if my /usr/share/terminfo/ folder is empty? –  julkiewicz Nov 21 '11 at 0:25
    
Yes, very. Sorry about the formatting. My system shows: walt@wombat:~(0)$ dpkg -S /usr/share/terminfo ncurses-term, ncurses-bin: /usr/share/terminfo walt@wombat:~(0)$ apt-cache search ncurses-term\|ncurses-bin ncurses-bin - terminal-related programs and man pages ncurses-term - additional terminal type definitions You probably should install these. –  waltinator Nov 21 '11 at 0:48
    
Ok, thanks - I believe this is the root of all the problems. I'll look into that and fix it. –  julkiewicz Nov 21 '11 at 1:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.