13

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?

3 Answers 3

13

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.

1
  • I have checked and gnome-terminal works fine, it is really an "emulator" bug. I am using terminator. Thanks Aug 24, 2010 at 6:58
11

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

3
  • 2
    getty is not called from inittab, Ubuntu doesn't have an inittab any more! The consoles are defined by /etc/init/tty*.conf Aug 24, 2010 at 6:18
  • 4
    I think you get a badge for the first use I've seen of footnotes in an answer :-)
    – poolie
    Nov 17, 2010 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!!) Jun 23, 2015 at 12:30
1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .