c82deedc97f7578fa0a8a2dd3c8b598a166bfd04

Author
Andrew Janke <andrew@apjanke.net>
Committer
Andrew Janke <andrew@apjanke.net>
Date

Message

agnoster: Protect Unicode esape sequences with local LC_* settings

Diff

 1diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme
 2index 3e454a0a0a76f8b97945d2d27bb1a2d6c549185e..6444dfa688921cf2476f7ff631c3ac4a323c630a 100644
 3--- a/themes/agnoster.zsh-theme
 4+++ b/themes/agnoster.zsh-theme
 5@@ -32,17 +32,19 @@ CURRENT_BG='NONE'
 6 
 7 # Special Powerline characters
 8 
 9-# NOTE: This segment separator character is correct.  In 2012, Powerline changed
10-# the code points they use for their special characters. This is the new code point.
11-# If this is not working for you, you probably have an old version of the 
12-# Powerline-patched fonts installed. Download and install the new version.
13-# Do not submit PRs to change this unless you have reviewed the Powerline code point
14-# history and have new information.
15-# This is defined using a Unicode escape sequence so it is unambiguously readable, regardless of
16-# what font the user is viewing this source code in. Do not replace the
17-# escape sequence with a single literal character.
18-SEGMENT_SEPARATOR='\ue0b0' # 
19-
20+() {
21+  local LC_ALL="" LC_CTYPE="en_US.UTF-8"
22+  # NOTE: This segment separator character is correct.  In 2012, Powerline changed
23+  # the code points they use for their special characters. This is the new code point.
24+  # If this is not working for you, you probably have an old version of the 
25+  # Powerline-patched fonts installed. Download and install the new version.
26+  # Do not submit PRs to change this unless you have reviewed the Powerline code point
27+  # history and have new information.
28+  # This is defined using a Unicode escape sequence so it is unambiguously readable, regardless of
29+  # what font the user is viewing this source code in. Do not replace the
30+  # escape sequence with a single literal character.
31+  SEGMENT_SEPARATOR=$'\ue0b0' # 
32+}
33 
34 # Begin a segment
35 # Takes two arguments, background and foreground. Both can be omitted,
36@@ -83,7 +85,12 @@ prompt_context() {
37 
38 # Git: branch/detached head, dirty status
39 prompt_git() {
40-  local PL_BRANCH_CHAR='\ue0a0'         # 
41+
42+  local PL_BRANCH_CHAR
43+  () {
44+    local LC_ALL="" LC_CTYPE="en_US.UTF-8"
45+    PL_BRANCH_CHAR=$'\ue0a0'         # 
46+  }
47   local ref dirty mode repo_path
48   repo_path=$(git rev-parse --git-dir 2>/dev/null)
49