summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2017-05-29 20:42:54 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2017-05-29 20:42:54 +0000
commit6022e44ffbe0e648b515461b5897f28bdcafb0b0 (patch)
treef5ff419a6ce56f5efd72dbe9e6965148794a0dfe
parent8c66aadba95962e258a8bc8f28a97ca6f09da869 (diff)
Add a flag to stop the prompt input being expanded.
-rw-r--r--usr.bin/tmux/status.c11
-rw-r--r--usr.bin/tmux/tmux.h3
2 files changed, 10 insertions, 4 deletions
diff --git a/usr.bin/tmux/status.c b/usr.bin/tmux/status.c
index 2021385ad11..8e90f52c721 100644
--- a/usr.bin/tmux/status.c
+++ b/usr.bin/tmux/status.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: status.c,v 1.167 2017/05/29 20:41:29 nicm Exp $ */
+/* $OpenBSD: status.c,v 1.168 2017/05/29 20:42:53 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -677,9 +677,14 @@ status_prompt_set(struct client *c, const char *msg, const char *input,
ft = format_create(c, NULL, FORMAT_NONE, 0);
format_defaults(ft, c, NULL, NULL, NULL);
-
t = time(NULL);
- tmp = format_expand_time(ft, input, t);
+
+ if (input == NULL)
+ input = "";
+ if (flags & PROMPT_NOFORMAT)
+ tmp = xstrdup(input);
+ else
+ tmp = format_expand_time(ft, input, t);
status_message_clear(c);
status_prompt_clear(c);
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h
index c80806506cf..11e0ff55054 100644
--- a/usr.bin/tmux/tmux.h
+++ b/usr.bin/tmux/tmux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.h,v 1.773 2017/05/29 20:41:29 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.774 2017/05/29 20:42:53 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1378,6 +1378,7 @@ struct client {
#define PROMPT_SINGLE 0x1
#define PROMPT_NUMERIC 0x2
#define PROMPT_INCREMENTAL 0x4
+#define PROMPT_NOFORMAT 0x8
int prompt_flags;
struct session *session;