]> arthur.barton.de Git - ax-zsh.git/commitdiff
Implement new axzsh_is_dumb_terminal() function, and use it
authorAlexander Barton <alex@barton.de>
Wed, 17 Aug 2016 21:00:31 +0000 (23:00 +0200)
committerAlexander Barton <alex@barton.de>
Wed, 17 Aug 2016 21:00:31 +0000 (23:00 +0200)
core/10_terminal/10_terminal.zshrc
plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zshrc

index e7c1eecfcb2b41404015c789e6da19217ae7b61f..88b8f0460915f9e3c9c92ec742ff71fa25240e15 100644 (file)
@@ -22,6 +22,14 @@ function axzsh_is_modern_terminal {
        return 1
 }
 
+# Test for "dumb" terminal
+function axzsh_is_dumb_terminal {
+       axzsh_is_modern_terminal && return 1
+       [[ "$TERM" = dumb* ]] && return 0
+       [[ "$TERM" = "vt52" ]] && return 0
+       return 1
+}
+
 # Resize terminal window (when possible)
 function axzsh_resize_terminal {
        printf '\e[8;%d;%dt' "$2" "$1"
@@ -89,6 +97,8 @@ function axzsh_terminal_title_preexec {
 
 preexec_functions+=(axzsh_terminal_title_preexec)
 
+axzsh_is_dumb_terminal && return 0
+
 # Colors
 
 autoload -Uz colors
index b1902abd62ab6dd10f784dde21b1f0b0e6e00bb0..cdc4ed9fc2061431d2a6776dcb15d026f299638f 100644 (file)
@@ -1,6 +1,8 @@
 # AX-ZSH: Alex' Modular ZSH Configuration
 # zsh-syntax-highlighting.zshrc: Initialize "ZSH Syntax Highlighting"
 
+axzsh_is_dumb_terminal && return 1
+
 for script (
        "/usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
        "/usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"