Tuesday, October 5, 2010

Ubuntu Maverick TERM variable

So on going up to Maverick Meerkat, I discovered that Tilda (my perferred terminal emulator) was suddenly throwing wierd errors, i.e. on running "clear" rather than a blank terminal window, I get "TERM environment variable not set."

The problem seems to affect many terminal emulators but the solution is simple, as I posted on a bug tracker:

On Ubuntu I think the easiest way to fix this problem, both workaround and packaged as a solution, is to make a simple script in /etc/profile.d/ . I called mine set_term.sh (must end in .sh). The file need only have in it

export TERM=xterm

and then either run "source /etc/profile" or reboot. This will set the $TERM variable for all users on each boot without hardcoding the variable as some of the other programs I listed above have done. In one command, for those who need it run:

echo "export TERM=xterm" | sudo tee /etc/profile.d/set_term.sh && source /etc/profile

No comments: