3

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 2

3

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.

2
  • is there a universal file for this job. someone told my about alias. but I could figure that out?
    – r004
    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 $TERM values were hardcoded.
    – vinc17
    Oct 5, 2014 at 15:52
1

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

You must log in to answer this question.

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