mirror of
https://github.com/tmux/tmux.git
synced 2026-06-20 17:25:57 +00:00
Be more strict about what names and titles we allow and reject them
immediately when possible, but allow # again for those directly set by commands (but not escape sequences). From Barrett Ruth in GitHub issue 5175.
This commit is contained in:
6
window.c
6
window.c
@@ -411,11 +411,11 @@ window_remove_ref(struct window *w, const char *from)
|
||||
}
|
||||
|
||||
void
|
||||
window_set_name(struct window *w, const char *new_name)
|
||||
window_set_name(struct window *w, const char *new_name, const char *forbid)
|
||||
{
|
||||
char *name;
|
||||
|
||||
name = clean_name(new_name, "#");
|
||||
name = clean_name(new_name, forbid);
|
||||
if (name != NULL) {
|
||||
free(w->name);
|
||||
w->name = name;
|
||||
@@ -1089,7 +1089,7 @@ window_pane_create(struct window *w, u_int sx, u_int sy, u_int hlimit)
|
||||
style_ranges_init(&wp->border_status_line.ranges);
|
||||
|
||||
if (gethostname(host, sizeof host) == 0)
|
||||
screen_set_title(&wp->base, host);
|
||||
screen_set_title(&wp->base, host, 0);
|
||||
|
||||
return (wp);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user