summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/status.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2011-07-08 06:37:58 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2011-07-08 06:37:58 +0000
commit12ceae2169c5fde32b67403312ac416dc4a2f577 (patch)
tree9c5329d0ef3b160e174ecf0574ad5cfa025ecd82 /usr.bin/tmux/status.c
parentc6f9982ea401963ae1092e0af8c210975bd9e0f8 (diff)
Make confirm-before prompt customizable with -p option like
command-prompt. Also move responsibility for calling status_replace into status_prompt_{set,update} and add #W and #P to the default kill-window and kill-pane prompts. By Tiago Cunha.
Diffstat (limited to 'usr.bin/tmux/status.c')
-rw-r--r--usr.bin/tmux/status.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/usr.bin/tmux/status.c b/usr.bin/tmux/status.c
index f8f9145d6c4..e96200331ef 100644
--- a/usr.bin/tmux/status.c
+++ b/usr.bin/tmux/status.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: status.c,v 1.76 2011/07/02 21:05:44 nicm Exp $ */
+/* $OpenBSD: status.c,v 1.77 2011/07/08 06:37:57 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -824,12 +824,13 @@ status_prompt_set(struct client *c, const char *msg, const char *input,
status_message_clear(c);
status_prompt_clear(c);
- c->prompt_string = xstrdup(msg);
+ c->prompt_string = status_replace(c, NULL, NULL, NULL, msg,
+ time(NULL), 0);
- if (input != NULL)
- c->prompt_buffer = xstrdup(input);
- else
- c->prompt_buffer = xstrdup("");
+ if (input == NULL)
+ input = "";
+ c->prompt_buffer = status_replace(c, NULL, NULL, NULL, input,
+ time(NULL), 0);
c->prompt_index = strlen(c->prompt_buffer);
c->prompt_callbackfn = callbackfn;
@@ -877,13 +878,14 @@ void
status_prompt_update(struct client *c, const char *msg, const char *input)
{
xfree(c->prompt_string);
- c->prompt_string = xstrdup(msg);
+ c->prompt_string = status_replace(c, NULL, NULL, NULL, msg,
+ time(NULL), 0);
xfree(c->prompt_buffer);
- if (input != NULL)
- c->prompt_buffer = xstrdup(input);
- else
- c->prompt_buffer = xstrdup("");
+ if (input == NULL)
+ input = "";
+ c->prompt_buffer = status_replace(c, NULL, NULL, NULL, input,
+ time(NULL), 0);
c->prompt_index = strlen(c->prompt_buffer);
c->prompt_hindex = 0;