]> arthur.barton.de Git - ax-zsh.git/blobdiff - core/10_terminal/10_terminal.zshrc
10_terminal: Add axzsh_is_utf_terminal and isutfenv functions
[ax-zsh.git] / 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"