=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/input.c,v retrieving revision 1.161 retrieving revision 1.162 diff -c -r1.161 -r1.162 *** src/usr.bin/tmux/input.c 2019/09/25 19:05:59 1.161 --- src/usr.bin/tmux/input.c 2019/10/14 09:19:40 1.162 *************** *** 1,4 **** ! /* $OpenBSD: input.c,v 1.161 2019/09/25 19:05:59 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: input.c,v 1.162 2019/10/14 09:19:40 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 2279,2284 **** --- 2279,2287 ---- static void input_exit_rename(struct input_ctx *ictx) { + struct window_pane *wp = ictx->wp; + struct options_entry *oe; + if (ictx->flags & INPUT_DISCARD) return; if (!options_get_number(ictx->wp->options, "allow-rename")) *************** *** 2287,2292 **** --- 2290,2302 ---- if (!utf8_isvalid(ictx->input_buf)) return; + + if (ictx->input_len == 0) { + oe = options_get(wp->window->options, "automatic-rename"); + if (oe != NULL) + options_remove(oe); + return; + } window_set_name(ictx->wp->window, ictx->input_buf); options_set_number(ictx->wp->window->options, "automatic-rename", 0); server_status_window(ictx->wp->window);