summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2011-07-03 18:18:15 +0000
committerNicholas Marriott <nicm@openbsd.org>2011-07-03 18:18:15 +0000
commit94f86edfee9480b0e35af8adc2e4371b3caa3bca (patch)
tree0de48cf09349b7a585d10d025d005d3eabfe5358
parentad60a2c952694919ed3985855ef5a00939a937b8 (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.
-rw-r--r--cmd-command-prompt.c5
-rw-r--r--key-bindings.c1
-rw-r--r--tmux.12
3 files changed, 8 insertions, 0 deletions
diff --git a/cmd-command-prompt.c b/cmd-command-prompt.c
index 48a11916..f0f1d12d 100644
--- a/cmd-command-prompt.c
+++ b/cmd-command-prompt.c
@@ -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/key-bindings.c b/key-bindings.c
index a3f7fb42..fe8a7576 100644
--- a/key-bindings.c
+++ b/key-bindings.c
@@ -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/tmux.1 b/tmux.1
index d33f7857..60d900a3 100644
--- a/tmux.1
+++ b/tmux.1
@@ -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 &