! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Terminal (version 0.4.5 with XFCE-4.8) doesn't honor TERM setting
Status:
RESOLVED: FIXED
Product:
Xfce4-terminal
Component:
General

Comments

Description Tassilo Horn 2011-01-24 14:10:15 CET
In the Terminal Preferences Advanced tab, it is possible to specify a value for the TERM variable.  I've set it to xterm-256color in order to have 256 instead of the usual 8 colors available.

Unfortunately, when starting a new terminal, the value of $TERM is still xterm (the default).
Comment 1 Tassilo Horn 2011-01-25 08:38:49 CET
As a workaround, I've now put

## Set TERM, cause the (XFCE) Terminal's TERM preference doesn't work...        
if [[ ${TERM} == "xterm" ]]; then                                               
    export TERM=xterm-256color                                                  
fi

into my ~/.zshrc.  As long as you don't use different terminal emulators and one of them doesn't support that setting, it should be ok.
Comment 2 Nick Schermer editbugs 2011-01-30 14:16:27 CET
Not terminals fault, it properly sets TERM in the child environment, however vte overrides this for some reason. Reported in https://bugzilla.gnome.org/show_bug.cgi?id=640940.
Comment 3 Tassilo Horn 2011-01-30 16:33:42 CET
Hi Nick,

thanks for pointing that out.

Tassilo
Comment 4 Lionel Elie Mamane 2012-06-25 12:26:27 CEST
(In reply to comment #1)

> ## Set TERM, cause the (XFCE) Terminal's TERM preference doesn't work...    
> 
> if [[ ${TERM} == "xterm" ]]; then                                           
> 
>     export TERM=xterm-256color                                              
> 
> fi
> 
> into my ~/.zshrc.  As long as you don't use different terminal emulators and
> one of them doesn't support that setting, it should be ok.

For multiple terminal emulators, do something like:


if [ "$COLORTERM" = "gnome-terminal" ] || [ "$COLORTERM" = "Terminal" ]
then
    export TERM=xterm-256color
fi
Comment 5 Lionel Elie Mamane 2012-06-25 12:34:56 CEST
The vte bug says that in order to override TERM setting, one should use vte_pty_new + g_spawn "manually" and not vte_terminal_fork_command_full(), which is "only" a "convenience wrapper".
Comment 6 Nick Schermer editbugs 2012-12-26 09:50:24 CET
Master sets emulation, which sets term through vte.
Comment 7 Yves-Alexis Perez editbugs 2012-12-31 16:33:12 CET
(In reply to comment #6)
> Master sets emulation, which sets term through vte.

Note that this won't work. VTE apparently only supports emulation=xterm (there's nothing else in /usr/share/vte/termcap-0.0/). So even though using TERM=xterm-256color works in a shell, it won't work in emulation mode.

In any case, messing with emulation is very error prone and can break the terminal. Messing with TERM is not really that bad (although it can leads to some surprising results).

Anyway, right now it's unfortunately not really possible (due to https://bugzilla.gnome.org/show_bug.cgi?id=640940) to set TERM in xfce4-terminal, so a workaround needs to be found (for example in .bashrc, although it has some problems too).

Bug #7178

Reported by:
Tassilo Horn
Reported on: 2011-01-24
Last modified on: 2012-12-31

People

Assignee:
Nick Schermer
CC List:
3 users

Version

Version:
unspecified

Attachments

Additional information