From 328f02bc3c0d7cbada53104fa680e28e872c3106 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Fri, 19 Feb 2016 11:01:04 +0100 Subject: [PATCH] 10_terminal: Add axzsh_is_utf_terminal and isutfenv functions The latter is an alias of the first, which is used by GRML ZSH. --- core/10_terminal/10_terminal.zshrc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/10_terminal/10_terminal.zshrc b/core/10_terminal/10_terminal.zshrc index 6fe59e9..614bf3d 100644 --- a/core/10_terminal/10_terminal.zshrc +++ b/core/10_terminal/10_terminal.zshrc @@ -1,6 +1,19 @@ # AX-ZSH: Alex' Modular ZSH Configuration # 10_terminal.zshrc: Initialize terminal settings +# Common helper functions + +# Check if terminal supports Unicode. +# +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" -- 2.39.2