mirror of
				https://github.com/tmux/tmux.git
				synced 2025-10-26 12:27:15 +00:00 
			
		
		
		
	Although we always have en_US.UTF-8 on OpenBSD, some platforms do not,
so fall back to setlocale(LC_CTYPE, ""). tmux requires a UTF-8 locale, so check with wcwidth() on a UTF-8 character after setlocale().
This commit is contained in:
		
							
								
								
									
										7
									
								
								tmux.c
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								tmux.c
									
									
									
									
									
								
							| @@ -188,9 +188,12 @@ main(int argc, char **argv) | |||||||
| 	const char	*s; | 	const char	*s; | ||||||
| 	int		 opt, flags, keys; | 	int		 opt, flags, keys; | ||||||
|  |  | ||||||
| 	setlocale(LC_CTYPE, "en_US.UTF-8"); | 	if (setlocale(LC_CTYPE, "en_US.UTF-8") == NULL) | ||||||
| 	setlocale(LC_TIME, ""); | 		setlocale(LC_CTYPE, ""); | ||||||
|  | 	if (wcwidth(0xfffd) != 1) | ||||||
|  | 		errx(1, "no UTF-8 locale; please set LC_CTYPE"); | ||||||
|  |  | ||||||
|  | 	setlocale(LC_TIME, ""); | ||||||
| 	tzset(); | 	tzset(); | ||||||
|  |  | ||||||
| 	if (**argv == '-') | 	if (**argv == '-') | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 nicm
					nicm