]> arthur.barton.de Git - ax-zsh.git/commitdiff
10_terminal: Fix up TERM for VTE-based terminals
authorAlexander Barton <alex@barton.de>
Fri, 26 Aug 2016 09:45:59 +0000 (11:45 +0200)
committerAlexander Barton <alex@barton.de>
Fri, 26 Aug 2016 09:45:59 +0000 (11:45 +0200)
core/10_terminal/10_terminal.zshrc

index 88b8f0460915f9e3c9c92ec742ff71fa25240e15..b90fbc531305557675c2edf2696a1d6fef0f2c6f 100644 (file)
@@ -1,6 +1,13 @@
 # AX-ZSH: Alex' Modular ZSH Configuration
 # 10_terminal.zshrc: Initialize terminal settings
 
+# Fix up TERM. Do this here (and not in zprofile), because terminal emulators
+# often don't start a new login shell but "only" a new interactive shell.
+
+# VTE based terminals (like GNOME Terminal) support 256 colors, but old(er)
+# versions of GNOME Terminal (at least) set TERM=xterm ...
+[[ "$TERM" = "xterm" && "$VTE_VERSION" != "" ]] && TERM="xterm-256color"
+
 # Common helper functions
 
 # Check if terminal supports Unicode.