mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Pass window titles through vis(1). <0x20 is dropped anyway by the input state
machine but top-bit-set nonprintables could cause trouble, and they are neater like this anyway. Suggested by deraadt a few days ago.
This commit is contained in:
		
							
								
								
									
										2
									
								
								input.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								input.c
									
									
									
									
									
								
							@@ -475,7 +475,7 @@ input_state_string_next(u_char ch, struct input_ctx *ictx)
 | 
				
			|||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (ch >= 0x20 && ch != 0x7f) {
 | 
						if (ch >= 0x20) {
 | 
				
			||||||
		if (input_add_string(ictx, ch) != 0)
 | 
							if (input_add_string(ictx, ch) != 0)
 | 
				
			||||||
			input_state(ictx, input_state_first);
 | 
								input_state(ictx, input_state_first);
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										7
									
								
								screen.c
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								screen.c
									
									
									
									
									
								
							@@ -19,6 +19,7 @@
 | 
				
			|||||||
#include <sys/types.h>
 | 
					#include <sys/types.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <string.h>
 | 
					#include <string.h>
 | 
				
			||||||
 | 
					#include <vis.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "tmux.h"
 | 
					#include "tmux.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -65,8 +66,12 @@ screen_free(struct screen *s)
 | 
				
			|||||||
void
 | 
					void
 | 
				
			||||||
screen_set_title(struct screen *s, const char *title)
 | 
					screen_set_title(struct screen *s, const char *title)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
						char	tmp[BUFSIZ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						strnvis(tmp, title, sizeof tmp, VIS_OCTAL|VIS_TAB|VIS_NL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	xfree(s->title);
 | 
						xfree(s->title);
 | 
				
			||||||
	s->title = xstrdup(title);
 | 
						s->title = xstrdup(tmp);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Resize screen. */
 | 
					/* Resize screen. */
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user