aboutsummaryrefslogtreecommitdiff
path: root/status.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2011-07-08 08:42:03 +0000
committerTiago Cunha <tcunha@gmx.com>2011-07-08 08:42:03 +0000
commitbba822105bb45ab998ebb7e8299ddc2b8989e672 (patch)
tree3901738866dabad26bc71ae16c2fceb4255ee16a /status.c
parentdc2c174496532a915120c6fd12b26df742a3ee8e (diff)
downloadrtmux-bba822105bb45ab998ebb7e8299ddc2b8989e672.tar.gz
rtmux-bba822105bb45ab998ebb7e8299ddc2b8989e672.tar.bz2
rtmux-bba822105bb45ab998ebb7e8299ddc2b8989e672.zip
Sync OpenBSD patchset 934:
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 'status.c')
-rw-r--r--status.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/status.c b/status.c
index f9c38a59..04669849 100644
--- a/status.c
+++ b/status.c
@@ -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;