summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2012-01-20 19:15:40 +0000
committernicm <nicm@openbsd.org>2012-01-20 19:15:40 +0000
commit8d7ec3691d604e46bd953c062ccf2f5edc854bdd (patch)
treeaa2ed608627c6b16966c515f02b5633bfec8a440
parentAdd space movement keys for vi mode in the status line from Ben Boeckel. (diff)
downloadwireguard-openbsd-8d7ec3691d604e46bd953c062ccf2f5edc854bdd.tar.xz
wireguard-openbsd-8d7ec3691d604e46bd953c062ccf2f5edc854bdd.zip
Add an option to disable the window rename escape sequence, from Romain
Francoise.
-rw-r--r--usr.bin/tmux/input.c4
-rw-r--r--usr.bin/tmux/options-table.c7
-rw-r--r--usr.bin/tmux/tmux.111
3 files changed, 18 insertions, 4 deletions
diff --git a/usr.bin/tmux/input.c b/usr.bin/tmux/input.c
index 55ca5d0eae1..351b84b94c1 100644
--- a/usr.bin/tmux/input.c
+++ b/usr.bin/tmux/input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: input.c,v 1.43 2011/12/29 08:06:24 nicm Exp $ */
+/* $OpenBSD: input.c,v 1.44 2012/01/20 19:15:40 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -1558,6 +1558,8 @@ input_exit_rename(struct input_ctx *ictx)
{
if (ictx->flags & INPUT_DISCARD)
return;
+ if (!options_get_number(&ictx->wp->window->options, "allow-rename"))
+ return;
log_debug("%s: \"%s\"", __func__, ictx->input_buf);
xfree(ictx->wp->window->name);
diff --git a/usr.bin/tmux/options-table.c b/usr.bin/tmux/options-table.c
index d6cebc2edd8..47648aa6b4f 100644
--- a/usr.bin/tmux/options-table.c
+++ b/usr.bin/tmux/options-table.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: options-table.c,v 1.16 2011/11/15 23:24:04 nicm Exp $ */
+/* $OpenBSD: options-table.c,v 1.17 2012/01/20 19:15:40 nicm Exp $ */
/*
* Copyright (c) 2011 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -436,6 +436,11 @@ const struct options_table_entry window_options_table[] = {
.default_num = 0
},
+ { .name = "allow-rename",
+ .type = OPTIONS_TABLE_FLAG,
+ .default_num = 1
+ },
+
{ .name = "alternate-screen",
.type = OPTIONS_TABLE_FLAG,
.default_num = 1
diff --git a/usr.bin/tmux/tmux.1 b/usr.bin/tmux/tmux.1
index 24b837af5c1..99cd3e0ee8a 100644
--- a/usr.bin/tmux/tmux.1
+++ b/usr.bin/tmux/tmux.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: tmux.1,v 1.261 2011/12/31 03:40:15 nicm Exp $
+.\" $OpenBSD: tmux.1,v 1.262 2012/01/20 19:15:40 nicm Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
.\"
@@ -14,7 +14,7 @@
.\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
.\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: December 31 2011 $
+.Dd $Mdocdate: January 20 2012 $
.Dt TMUX 1
.Os
.Sh NAME
@@ -2342,6 +2342,13 @@ this option is good for full-screen programs which support
.Dv SIGWINCH
and poor for interactive programs such as shells.
.Pp
+.It Xo Ic allow-rename
+.Op Ic on | off
+.Xc
+Allow programs to change the window name using a terminal escape
+sequence (\\033k...\\033\\\\).
+The default is on.
+.Pp
.It Xo Ic alternate-screen
.Op Ic on | off
.Xc