]> arthur.barton.de Git - ax-zsh.git/commitdiff
10_terminal: Add axzsh_is_utf_terminal and isutfenv functions
authorAlexander Barton <alex@barton.de>
Fri, 19 Feb 2016 10:01:04 +0000 (11:01 +0100)
committerAlexander Barton <alex@barton.de>
Fri, 19 Feb 2016 10:01:07 +0000 (11:01 +0100)
The latter is an alias of the first, which is used by GRML ZSH.

core/10_terminal/10_terminal.zshrc

index 6fe59e991afef7723ead8caeb8d934ab95240241..614bf3dca86877e06c701bcdae34191edfc2e904 100644 (file)
@@ -1,6 +1,19 @@
 # AX-ZSH: Alex' Modular ZSH Configuration
 # 10_terminal.zshrc: Initialize terminal settings
 
+# Common helper functions
+
+# Check if terminal supports Unicode.
+# <https://wiki.grml.org/doku.php?id=utf8>
+function axzsh_is_utf_terminal {
+       case "$LANG $CHARSET $LANGUAGE" in
+               (*utf*) return 0 ;;
+               (*UTF*) return 0 ;;
+               (*) return 1 ;;
+       esac
+}
+alias isutfenv=axzsh_is_utf_terminal
+
 # Set terminal title
 
 # Set terminal "hardstatus" and "icon title"