summaryrefslogtreecommitdiff
path: root/usr.bin/tmux
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2011-07-03 18:18:16 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2011-07-03 18:18:16 +0000
commit767d41f3616fb1e153fbee01653f2bf97897f4b1 (patch)
tree82fbcc5934a5d49c697dc72cdcc27bea887a8405 /usr.bin/tmux
parente76c0d219d76343b61728f7e74319328e74fa975 (diff)
Include the existing window and session name in the prompt when renaming
and add a new key binding ($) for rename session. From Tiago Cunha.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r--usr.bin/tmux/cmd-command-prompt.c7
-rw-r--r--usr.bin/tmux/key-bindings.c3
-rw-r--r--usr.bin/tmux/tmux.16
3 files changed, 12 insertions, 4 deletions
diff --git a/usr.bin/tmux/cmd-command-prompt.c b/usr.bin/tmux/cmd-command-prompt.c
index c399760db3a..08cfa457081 100644
--- a/usr.bin/tmux/cmd-command-prompt.c
+++ b/usr.bin/tmux/cmd-command-prompt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-command-prompt.c,v 1.17 2011/07/02 21:05:44 nicm Exp $ */
+/* $OpenBSD: cmd-command-prompt.c,v 1.18 2011/07/03 18:18:15 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -59,8 +59,13 @@ void
cmd_command_prompt_key_binding(struct cmd *self, int key)
{
switch (key) {
+ case '$':
+ self->args = args_create(1, "rename-session '%%'");
+ args_set(self->args, 'I', "#S");
+ break;
case ',':
self->args = args_create(1, "rename-window '%%'");
+ args_set(self->args, 'I', "#W");
break;
case '.':
self->args = args_create(1, "move-window -t '%%'");
diff --git a/usr.bin/tmux/key-bindings.c b/usr.bin/tmux/key-bindings.c
index 8cf556e20ab..1c51fccef8c 100644
--- a/usr.bin/tmux/key-bindings.c
+++ b/usr.bin/tmux/key-bindings.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: key-bindings.c,v 1.27 2011/01/04 00:42:47 nicm Exp $ */
+/* $OpenBSD: key-bindings.c,v 1.28 2011/07/03 18:18:15 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -106,6 +106,7 @@ key_bindings_init(void)
{ '!', 0, &cmd_break_pane_entry },
{ '"', 0, &cmd_split_window_entry },
{ '#', 0, &cmd_list_buffers_entry },
+ { '$', 0, &cmd_command_prompt_entry },
{ '%', 0, &cmd_split_window_entry },
{ '&', 0, &cmd_confirm_before_entry },
{ '(', 0, &cmd_switch_client_entry },
diff --git a/usr.bin/tmux/tmux.1 b/usr.bin/tmux/tmux.1
index c67aa65d5a2..3fd0992870a 100644
--- a/usr.bin/tmux/tmux.1
+++ b/usr.bin/tmux/tmux.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: tmux.1,v 1.235 2011/07/02 21:05:44 nicm Exp $
+.\" $OpenBSD: tmux.1,v 1.236 2011/07/03 18:18:15 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: July 2 2011 $
+.Dd $Mdocdate: July 3 2011 $
.Dt TMUX 1
.Os
.Sh NAME
@@ -233,6 +233,8 @@ Break the current pane out of the window.
Split the current pane into two, top and bottom.
.It #
List all paste buffers.
+.It $
+Rename the current session.
.It %
Split the current pane into two, left and right.
.It &