aboutsummaryrefslogtreecommitdiff
path: root/status.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2008-06-21 14:11:39 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2008-06-21 14:11:39 +0000
commite70e9513a82a817edf35c86cb8b7f5ff2736c771 (patch)
treeb49787558eeefccf049972406233d5ed02155d00 /status.c
parent456ff329c37e4c9acf815d74353638e4829e868e (diff)
downloadrtmux-e70e9513a82a817edf35c86cb8b7f5ff2736c771.tar.gz
rtmux-e70e9513a82a817edf35c86cb8b7f5ff2736c771.tar.bz2
rtmux-e70e9513a82a817edf35c86cb8b7f5ff2736c771.zip
Simple tab completion of option names in command prompt.
Diffstat (limited to 'status.c')
-rw-r--r--status.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/status.c b/status.c
index d4ba281d..72f6060a 100644
--- a/status.c
+++ b/status.c
@@ -1,4 +1,4 @@
-/* $Id: status.c,v 1.36 2008-06-19 22:51:27 nicm Exp $ */
+/* $Id: status.c,v 1.37 2008-06-21 14:11:39 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -372,6 +372,7 @@ status_prompt_redraw(struct client *c)
void
status_prompt_key(struct client *c, int key)
{
+ char *s;
size_t size;
size = strlen(c->prompt_buffer);
@@ -400,6 +401,20 @@ status_prompt_key(struct client *c, int key)
c->flags |= CLIENT_STATUS;
}
break;
+ case '\011':
+ if (strchr(c->prompt_buffer, ' ') != NULL)
+ break;
+ if (c->prompt_index != strlen(c->prompt_buffer))
+ break;
+
+ s = cmd_complete(c->prompt_buffer);
+ xfree(c->prompt_buffer);
+
+ c->prompt_buffer = s;
+ c->prompt_index = strlen(c->prompt_buffer);
+
+ c->flags |= CLIENT_STATUS;
+ break;
case '\010':
case '\177':
if (c->prompt_index != 0) {