Is there a way to set different $TERM for different terminal emulators. For example if I am in xterm the $TERM will read xterm-256color, in urxvt urxvt-256color, in sakura xterm-256color and in tmux screen-256color.
2 Answers
You can do this in your terminal configuration. For instance, with Xterm, this can be done via the X resources. You can do this via the Xterm app-defaults:
*termName: xterm-256color
or via a -tn xterm-256color option. This is similar for rxvt.
-
is there a universal file for this job. someone told my about alias. but I could figure that out?r004– r0042014-10-05 13:36:45 +00:00Commented Oct 5, 2014 at 13:36
-
@r004 There is no universal file. Worse than that, each terminal has its own method to configure
$TERM, and I've already seen terminals where the possible$TERMvalues were hardcoded.vinc17– vinc172014-10-05 15:52:26 +00:00Commented Oct 5, 2014 at 15:52
There is no general method. As observed by vinc17, different terminal emulators let you configure the TERM value in different ways, if at all.
You can drop terminfo configuration files into your home directory, organized as ~/.terminfo/INITIAL-LETTER/VALUE. For example, if you wish for xterm to point to the 256-color entry, on a typical machine, you could do
mkdir -p ~/.terminfo/x
ln -s /usr/share/terminfo/x/xterm-256color ~/.terminfo/x/xterm