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:
10
input.c
10
input.c
@@ -2664,7 +2664,7 @@ input_exit_osc(struct input_ctx *ictx)
|
||||
case 2:
|
||||
if (wp != NULL &&
|
||||
options_get_number(wp->options, "allow-set-title") &&
|
||||
screen_set_title(sctx->s, p)) {
|
||||
screen_set_title(sctx->s, p, 1)) {
|
||||
notify_pane("pane-title-changed", wp);
|
||||
server_redraw_window_borders(wp->window);
|
||||
server_status_window(wp->window);
|
||||
@@ -2674,7 +2674,7 @@ input_exit_osc(struct input_ctx *ictx)
|
||||
input_osc_4(ictx, p);
|
||||
break;
|
||||
case 7:
|
||||
if (screen_set_path(sctx->s, p) && wp != NULL) {
|
||||
if (wp != NULL && screen_set_path(sctx->s, p, 1)) {
|
||||
server_redraw_window_borders(wp->window);
|
||||
server_status_window(wp->window);
|
||||
}
|
||||
@@ -2742,7 +2742,7 @@ input_exit_apc(struct input_ctx *ictx)
|
||||
|
||||
if (wp != NULL &&
|
||||
options_get_number(wp->options, "allow-set-title") &&
|
||||
screen_set_title(sctx->s, ictx->input_buf)) {
|
||||
screen_set_title(sctx->s, ictx->input_buf, 1)) {
|
||||
notify_pane("pane-title-changed", wp);
|
||||
server_redraw_window_borders(wp->window);
|
||||
server_status_window(wp->window);
|
||||
@@ -2785,10 +2785,10 @@ input_exit_rename(struct input_ctx *ictx)
|
||||
if (o != NULL)
|
||||
options_remove_or_default(o, -1, NULL);
|
||||
if (!options_get_number(w->options, "automatic-rename"))
|
||||
window_set_name(w, "");
|
||||
window_set_name(w, "", WINDOW_NAME_FORBID_EXT);
|
||||
} else {
|
||||
options_set_number(w->options, "automatic-rename", 0);
|
||||
window_set_name(w, ictx->input_buf);
|
||||
window_set_name(w, ictx->input_buf, WINDOW_NAME_FORBID_EXT);
|
||||
}
|
||||
server_redraw_window_borders(w);
|
||||
server_status_window(w);
|
||||
|
||||
Reference in New Issue
Block a user