$TERM set to "dumb" causes problems with suspend

5,089

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:
5,089

Related videos on Youtube

julkiewicz
Author by

julkiewicz

Currently working on a social game for Facebook using Django framework. Before that, written another application for Facebook in Grails. My professional interests include game design, functional programming, programming in logic, computer language design. Apart from work, I'm interested in cinema, economy, politics.

Updated on September 18, 2022

Comments

  • julkiewicz
    julkiewicz almost 2 years

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

    • enzotib
      enzotib over 12 years
      Have you tried commenting the clear?
    • julkiewicz
      julkiewicz over 12 years
      @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
    julkiewicz over 12 years
    Is it worrying if my /usr/share/terminfo/ folder is empty?
  • goo
    goo over 12 years
    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.
  • julkiewicz
    julkiewicz over 12 years
    Ok, thanks - I believe this is the root of all the problems. I'll look into that and fix it.