mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 01:34:18 +00:00 
			
		
		
		
	If -u is specified or UTF-8 is otherwise detected when the server is started,
enable the utf8 and status-utf8 optons. While here, note in the man page that the server is started with the first session and exits when none remain.
This commit is contained in:
		
							
								
								
									
										12
									
								
								tmux.1
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								tmux.1
									
									
									
									
									
								
							@@ -36,11 +36,13 @@ controlled from a single terminal.
 | 
				
			|||||||
.Pp
 | 
					.Pp
 | 
				
			||||||
.Nm
 | 
					.Nm
 | 
				
			||||||
runs as a server-client system.
 | 
					runs as a server-client system.
 | 
				
			||||||
A server is created automatically when necessary and holds a number of
 | 
					A server holds a number of
 | 
				
			||||||
.Em sessions ,
 | 
					.Em sessions ,
 | 
				
			||||||
each of which may have a number of
 | 
					each of which may have a number of
 | 
				
			||||||
.Em windows
 | 
					.Em windows
 | 
				
			||||||
linked to it.
 | 
					linked to it.
 | 
				
			||||||
 | 
					A server is started automatically when the first session is created and exits
 | 
				
			||||||
 | 
					when all the sessions it contains are destroyed.
 | 
				
			||||||
A window may be split on screen into one or more
 | 
					A window may be split on screen into one or more
 | 
				
			||||||
.Em panes ,
 | 
					.Em panes ,
 | 
				
			||||||
each of which is a separate terminal.
 | 
					each of which is a separate terminal.
 | 
				
			||||||
@@ -123,6 +125,14 @@ This is not always correct: the
 | 
				
			|||||||
flag explicitly informs
 | 
					flag explicitly informs
 | 
				
			||||||
.Nm
 | 
					.Nm
 | 
				
			||||||
that UTF-8 is supported.
 | 
					that UTF-8 is supported.
 | 
				
			||||||
 | 
					.Pp
 | 
				
			||||||
 | 
					If the server is started from a client passed
 | 
				
			||||||
 | 
					.Fl u
 | 
				
			||||||
 | 
					or where UTF-8 is detected, the
 | 
				
			||||||
 | 
					.Ic utf8
 | 
				
			||||||
 | 
					and
 | 
				
			||||||
 | 
					.Ic status-utf8
 | 
				
			||||||
 | 
					options are enabled in the global window and session options respectively.
 | 
				
			||||||
.It Fl v
 | 
					.It Fl v
 | 
				
			||||||
Request verbose logging.
 | 
					Request verbose logging.
 | 
				
			||||||
This option may be specified multiple times for increasing verbosity.
 | 
					This option may be specified multiple times for increasing verbosity.
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										42
									
								
								tmux.c
									
									
									
									
									
								
							
							
						
						
									
										42
									
								
								tmux.c
									
									
									
									
									
								
							@@ -266,6 +266,22 @@ main(int argc, char **argv)
 | 
				
			|||||||
	log_open_tty(debug_level);
 | 
						log_open_tty(debug_level);
 | 
				
			||||||
	siginit();
 | 
						siginit();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (!(flags & IDENTIFY_UTF8)) {
 | 
				
			||||||
 | 
							/*
 | 
				
			||||||
 | 
							 * If the user has set whichever of LC_ALL, LC_CTYPE or LANG
 | 
				
			||||||
 | 
							 * exist (in that order) 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("LC_ALL")) == NULL) {
 | 
				
			||||||
 | 
								if ((s = getenv("LC_CTYPE")) == NULL)
 | 
				
			||||||
 | 
									s = getenv("LANG");
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							if (s != NULL && strcasestr(s, "UTF-8") != NULL)
 | 
				
			||||||
 | 
								flags |= IDENTIFY_UTF8;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	options_init(&global_s_options, NULL);
 | 
						options_init(&global_s_options, NULL);
 | 
				
			||||||
	options_set_number(&global_s_options, "bell-action", BELL_ANY);
 | 
						options_set_number(&global_s_options, "bell-action", BELL_ANY);
 | 
				
			||||||
	options_set_number(&global_s_options, "buffer-limit", 9);
 | 
						options_set_number(&global_s_options, "buffer-limit", 9);
 | 
				
			||||||
@@ -292,7 +308,10 @@ main(int argc, char **argv)
 | 
				
			|||||||
	options_set_string(&global_s_options, "status-left", "[#S]");
 | 
						options_set_string(&global_s_options, "status-left", "[#S]");
 | 
				
			||||||
	options_set_string(
 | 
						options_set_string(
 | 
				
			||||||
	    &global_s_options, "status-right", "\"#24T\" %%H:%%M %%d-%%b-%%y");
 | 
						    &global_s_options, "status-right", "\"#24T\" %%H:%%M %%d-%%b-%%y");
 | 
				
			||||||
	options_set_number(&global_s_options, "status-utf8", 0);
 | 
						if (flags & IDENTIFY_UTF8)
 | 
				
			||||||
 | 
							options_set_number(&global_s_options, "status-utf8", 1);
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
							options_set_number(&global_s_options, "status-utf8", 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	options_init(&global_w_options, NULL);
 | 
						options_init(&global_w_options, NULL);
 | 
				
			||||||
	options_set_number(&global_w_options, "aggressive-resize", 0);
 | 
						options_set_number(&global_w_options, "aggressive-resize", 0);
 | 
				
			||||||
@@ -309,29 +328,16 @@ main(int argc, char **argv)
 | 
				
			|||||||
	options_set_number(&global_w_options, "mode-keys", MODEKEY_EMACS);
 | 
						options_set_number(&global_w_options, "mode-keys", MODEKEY_EMACS);
 | 
				
			||||||
	options_set_number(&global_w_options, "monitor-activity", 0);
 | 
						options_set_number(&global_w_options, "monitor-activity", 0);
 | 
				
			||||||
	options_set_string(&global_w_options, "monitor-content", "%s", "");
 | 
						options_set_string(&global_w_options, "monitor-content", "%s", "");
 | 
				
			||||||
	options_set_number(&global_w_options, "utf8", 0);
 | 
						if (flags & IDENTIFY_UTF8)
 | 
				
			||||||
 | 
							options_set_number(&global_w_options, "utf8", 1);
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
							options_set_number(&global_w_options, "utf8", 0);
 | 
				
			||||||
	options_set_number(&global_w_options, "window-status-attr", 0);
 | 
						options_set_number(&global_w_options, "window-status-attr", 0);
 | 
				
			||||||
	options_set_number(&global_w_options, "window-status-bg", 8);
 | 
						options_set_number(&global_w_options, "window-status-bg", 8);
 | 
				
			||||||
	options_set_number(&global_w_options, "window-status-fg", 8);
 | 
						options_set_number(&global_w_options, "window-status-fg", 8);
 | 
				
			||||||
	options_set_number(&global_w_options, "xterm-keys", 0);
 | 
						options_set_number(&global_w_options, "xterm-keys", 0);
 | 
				
			||||||
 	options_set_number(&global_w_options, "remain-on-exit", 0);
 | 
					 	options_set_number(&global_w_options, "remain-on-exit", 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!(flags & IDENTIFY_UTF8)) {
 | 
					 | 
				
			||||||
		/*
 | 
					 | 
				
			||||||
		 * If the user has set whichever of LC_ALL, LC_CTYPE or LANG
 | 
					 | 
				
			||||||
		 * exist (in that order) 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("LC_ALL")) == NULL) {
 | 
					 | 
				
			||||||
			if ((s = getenv("LC_CTYPE")) == NULL)
 | 
					 | 
				
			||||||
				s = getenv("LANG");
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		if (s != NULL && strcasestr(s, "UTF-8") != NULL)
 | 
					 | 
				
			||||||
			flags |= IDENTIFY_UTF8;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (cfg_file == NULL) {
 | 
						if (cfg_file == NULL) {
 | 
				
			||||||
		home = getenv("HOME");
 | 
							home = getenv("HOME");
 | 
				
			||||||
		if (home == NULL || *home == '\0') {
 | 
							if (home == NULL || *home == '\0') {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user