mirror of
https://github.com/tmux/tmux.git
synced 2026-05-30 14:16:18 +00:00
Sanitize pane titles and window and session names more consistently and
strictly, prevents C0 characters and other nonvisible characters causing problems. Reported (with a different fix) by Chris Monardo in GitHub issue 4999.
This commit is contained in:
8
spawn.c
8
spawn.c
@@ -84,6 +84,7 @@ spawn_window(struct spawn_context *sc, char **cause)
|
||||
struct winlink *wl;
|
||||
int idx = sc->idx;
|
||||
u_int sx, sy, xpixel, ypixel;
|
||||
char *name;
|
||||
|
||||
spawn_log(__func__, sc);
|
||||
|
||||
@@ -182,8 +183,11 @@ spawn_window(struct spawn_context *sc, char **cause)
|
||||
if (~sc->flags & SPAWN_RESPAWN) {
|
||||
free(w->name);
|
||||
if (sc->name != NULL) {
|
||||
w->name = format_single(item, sc->name, c, s, NULL,
|
||||
NULL);
|
||||
name = format_single(item, sc->name, c, s, NULL, NULL);
|
||||
w->name = clean_name(name, "#");
|
||||
free(name);
|
||||
if (w->name == NULL)
|
||||
w->name = xstrdup("");
|
||||
options_set_number(w->options, "automatic-rename", 0);
|
||||
} else
|
||||
w->name = default_window_name(w);
|
||||
|
||||
Reference in New Issue
Block a user