mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 21:56:57 +00:00
If automatic-rename is off, allow the escape sequence to set an empty
window name, GitHub issue 2964.
This commit is contained in:
16
input.c
16
input.c
@ -2382,6 +2382,7 @@ static void
|
|||||||
input_exit_rename(struct input_ctx *ictx)
|
input_exit_rename(struct input_ctx *ictx)
|
||||||
{
|
{
|
||||||
struct window_pane *wp = ictx->wp;
|
struct window_pane *wp = ictx->wp;
|
||||||
|
struct window *w;
|
||||||
struct options_entry *o;
|
struct options_entry *o;
|
||||||
|
|
||||||
if (wp == NULL)
|
if (wp == NULL)
|
||||||
@ -2394,17 +2395,20 @@ input_exit_rename(struct input_ctx *ictx)
|
|||||||
|
|
||||||
if (!utf8_isvalid(ictx->input_buf))
|
if (!utf8_isvalid(ictx->input_buf))
|
||||||
return;
|
return;
|
||||||
|
w = wp->window;
|
||||||
|
|
||||||
if (ictx->input_len == 0) {
|
if (ictx->input_len == 0) {
|
||||||
o = options_get_only(wp->window->options, "automatic-rename");
|
o = options_get_only(w->options, "automatic-rename");
|
||||||
if (o != NULL)
|
if (o != NULL)
|
||||||
options_remove_or_default(o, -1, NULL);
|
options_remove_or_default(o, -1, NULL);
|
||||||
return;
|
if (!options_get_number(w->options, "automatic-rename"))
|
||||||
|
window_set_name(w, "");
|
||||||
|
} else {
|
||||||
|
options_set_number(w->options, "automatic-rename", 0);
|
||||||
|
window_set_name(w, ictx->input_buf);
|
||||||
}
|
}
|
||||||
window_set_name(wp->window, ictx->input_buf);
|
server_redraw_window_borders(w);
|
||||||
options_set_number(wp->window->options, "automatic-rename", 0);
|
server_status_window(w);
|
||||||
server_redraw_window_borders(wp->window);
|
|
||||||
server_status_window(wp->window);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Open UTF-8 character. */
|
/* Open UTF-8 character. */
|
||||||
|
Reference in New Issue
Block a user