Last active
May 16, 2017 10:12
-
-
Save uwabami/04d661a4ffe3d0aa5198d19a8f488620 to your computer and use it in GitHub Desktop.
tmux v2.3 で en_US.UTF-8 決め打ちを止めるpatch。ロケールの修正か wcwidth-cjk 使うの前提。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From: Youhei SASAKI <uwabami@gfd-dennou.org> | |
Date: Sat, 4 Feb 2017 03:30:21 +0900 | |
Subject: Unse locale as en_US.UTF-8 | |
Signed-off-by: Youhei SASAKI <uwabami@gfd-dennou.org> | |
--- | |
tmux.c | 12 +++++------- | |
1 file changed, 5 insertions(+), 7 deletions(-) | |
--- a/tmux.c | |
+++ b/tmux.c | |
@@ -188,13 +188,11 @@ | |
const char *s; | |
int opt, flags, keys; | |
- if (setlocale(LC_CTYPE, "en_US.UTF-8") == NULL) { | |
- if (setlocale(LC_CTYPE, "") == NULL) | |
- errx(1, "invalid LC_ALL, LC_CTYPE or LANG"); | |
- s = nl_langinfo(CODESET); | |
- if (strcasecmp(s, "UTF-8") != 0 && strcasecmp(s, "UTF8") != 0) | |
- errx(1, "need UTF-8 locale (LC_CTYPE) but have %s", s); | |
- } | |
+ if (setlocale(LC_CTYPE, "") == NULL) | |
+ errx(1, "invalid LC_ALL, LC_CTYPE or LANG"); | |
+ s = nl_langinfo(CODESET); | |
+ if (strcasecmp(s, "UTF-8") != 0 && strcasecmp(s, "UTF8") != 0) | |
+ errx(1, "need UTF-8 locale (LC_CTYPE) but have %s", s); | |
setlocale(LC_TIME, ""); | |
tzset(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment