Ubuntu – Change environment variable (TERM)

environment-variablesterminator

According to this answer, "it is the job of the terminal emulator to set the TERM environment variable".

Is there any way to change the TERM value used by Terminator? Right now it's xterm, but I need xterm-256color.

I use other terminal emulators (Gnome Terminator, tmux), so setting in my .bashrc would be messy at best.

Best Answer

The way I do it is using a custom_command in ~/.config/terminator/config as follows:

...
[profiles]
  [[default]]
    ...
    custom_command = TERM=xterm-256color bash -l # Do not use 'terminator' here
    use_custom_command = True
    ...

This works like a charm i.e. for the 256-color skins for midnight commander. The -l option makes bash run as a login shell (which means that it will load settings from your .bash_profile). You can omit it if you prefer Terminator to launch bash as a non-login shell (so that it will load .bashrc instead).

Related Question