aboutsummaryrefslogtreecommitdiff
path: root/tmux.c
diff options
context:
space:
mode:
Diffstat (limited to 'tmux.c')
-rw-r--r--tmux.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/tmux.c b/tmux.c
index 67231221..13787ceb 100644
--- a/tmux.c
+++ b/tmux.c
@@ -1,4 +1,4 @@
-/* $Id: tmux.c,v 1.120 2009-05-19 13:32:55 tcunha Exp $ */
+/* $Id: tmux.c,v 1.121 2009-05-19 16:03:18 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -223,7 +223,7 @@ main(int argc, char **argv)
struct hdr hdr;
const char *shell;
struct passwd *pw;
- char *path, *label, *cause, *home, *pass = NULL;
+ char *s, *path, *label, *cause, *home, *pass = NULL;
char cwd[MAXPATHLEN];
int retcode, opt, flags, unlock, start_server;
@@ -336,6 +336,17 @@ main(int argc, char **argv)
options_set_number(&global_window_options, "xterm-keys", 0);
options_set_number(&global_window_options, "remain-on-exit", 0);
+ if (!(flags & IDENTIFY_UTF8)) {
+ /*
+ * If the user has set LANG to contain UTF-8, it is a safe
+ * assumption that either they are using a UTF-8 terminal, or
+ * if not they know that output from UTF-8-capable programs may
+ * be wrong.
+ */
+ if ((s = getenv("LANG")) != NULL && strstr(s, "UTF-8") != NULL)
+ flags |= IDENTIFY_UTF8;
+ }
+
if (cfg_file == NULL) {
home = getenv("HOME");
if (home == NULL || *home == '\0') {