Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

After upgrading to Maverick I have my TERM variable set to 'dumb', this does not happen with the same home dir running from Lucid and I didn't manually changed anything related to TERM.

Any idea where is the TERM variable expected to be set from?

share|improve this question
up vote 10 down vote accepted

To elaborate on what Gilles says, suppose you are remote connecting to your ubuntu from Windows using Putty.

In the putty config options, under Connection->Data there is a setting called terminal-type string. You can set your TERM there and putty instructs SSH to set that environment variable. At some point after that your shell is going to be executed, probably /bin/bash and it gets its environment from its parent process, probably the sshd process.

The same holds true if you ssh from a remote linux box, its just that the local TERM environment variable is passed through via ssh to the remote connection.

In the case of a terminal emulator it is the job of the terminal emulator to set the TERM environment variable. e.g. getty sets TERM to "linux" and forks a shell process (/bin/bash). or gnome-terminal sets TERM to "xterm" and forks a shell process.

share|improve this answer
I have checked and gnome-terminal works fine, it is really an "emulator" bug. I am using terminator. Thanks – João Pinto Aug 24 '10 at 6:58

To answer your question literally, the terminal emulator is supposed to set $TERM

To solve your problem would require at least knowing what terminal emulator you use. It could be a bug or misconfiguration in the terminal emulator or a problem with your shell startup files (probably ~/.bashrc, but possibly ~/.bash_profile, /etc/bashrc, /etc/profile, ...).

¹ Assuming you're not using a hardware terminal; then it would be the argument to getty, called from inittab (older releases using SysVinit) or /etc/init/tty*.conf (Ubuntu ≥9.10, using Upstart).

share|improve this answer
getty is not called from inittab, Ubuntu doesn't have an inittab any more! The consoles are defined by /etc/init/tty*.conf – LassePoulsen Aug 24 '10 at 6:18
I think you get a badge for the first use I've seen of footnotes in an answer :-) – poolie Nov 17 '10 at 1:44
now that it is 15.04+ upstart no longer is the default anymore (again) and systemd handles it in the getty@ service, i am still getting used to that change (it figures once I learned everything about upstart in and out, now I have to do the same with systemd... meh!!) – osirisgothra Jun 23 '15 at 12:30

If you want to change the terminal make sure you check out the update-alternatives functionality.

For instance:

update-alternatives --config x-terminal-emulator

Many of the various system default options in Ubuntu are set via this method. Another common one would be a www-browser

update-alternatives --config x-www-browser
share|improve this answer

Your Answer


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.