4

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).

jrg
  • 61,707

1 Answers1

2

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.

waltinator
  • 37,856