aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2007-09-26 19:09:30 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2007-09-26 19:09:30 +0000
commit2a3e209ccedd5d737e6a778481e54ca042f3ab5f (patch)
tree48d11524eab2631544bdcfee6d0bec83bc887843
parentab718378cb58280b3790ae18895cc0359f36d357 (diff)
downloadrtmux-2a3e209ccedd5d737e6a778481e54ca042f3ab5f.tar.gz
rtmux-2a3e209ccedd5d737e6a778481e54ca042f3ab5f.tar.bz2
rtmux-2a3e209ccedd5d737e6a778481e54ca042f3ab5f.zip
Extend op string and add potential for a single alias.
-rw-r--r--NOTES2
-rw-r--r--TODO1
-rw-r--r--client.c4
-rw-r--r--tmux.c14
4 files changed, 13 insertions, 8 deletions
diff --git a/NOTES b/NOTES
index eacc1308..9818d270 100644
--- a/NOTES
+++ b/NOTES
@@ -2,6 +2,8 @@
don't expect a lot of progress soon. Contributions welcome!
-- Nicholas <nicm@users.sf.net>
+XXX This is out of date!
+
Command prefix is C-b. This can be changed by building with, for example:
META=\\001 make
diff --git a/TODO b/TODO
index 865472bb..8a07a3f6 100644
--- a/TODO
+++ b/TODO
@@ -21,3 +21,4 @@
and buffer_insert_range/delete_range are abominations. this should be
rethought
- figure out once and for all what is going on with backspace and del
+- split list into list-sessions and list-windows
diff --git a/client.c b/client.c
index 0ea9c5bb..3593cc58 100644
--- a/client.c
+++ b/client.c
@@ -1,4 +1,4 @@
-/* $Id: client.c,v 1.4 2007-09-26 18:50:49 nicm Exp $ */
+/* $Id: client.c,v 1.5 2007-09-26 19:09:30 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -165,7 +165,7 @@ client_main(struct client_ctx *cctx)
/* XXX Output flushed; pause if required. */
if (n)
usleep(750000);
- /* XXX XXX special return code for pause */
+ /* XXX XXX special return code for pause? or flag in cctx? */
if ((n = client_process_local(cctx, &error)) == -1)
break;
if ((n = client_msg_dispatch(cctx, &error)) == -1)
diff --git a/tmux.c b/tmux.c
index 8b996316..88d517c3 100644
--- a/tmux.c
+++ b/tmux.c
@@ -1,4 +1,4 @@
-/* $Id: tmux.c,v 1.11 2007-09-26 18:32:16 nicm Exp $ */
+/* $Id: tmux.c,v 1.12 2007-09-26 19:09:30 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -39,13 +39,14 @@ int debug_level;
void sighandler(int);
struct op {
- const char *cmd;
+ const char *cmd;
+ const char *alias;
int (*fn)(char *, int, char **);
};
struct op op_table[] = {
- { "list", op_list },
- { "new", op_new },
- { "attach", op_attach }
+ { "attach", NULL, op_attach },
+ { "list-sessions", "ls", op_list },
+ { "new-session", "new", op_new },
};
#define NOP (sizeof op_table / sizeof op_table[0])
@@ -182,7 +183,8 @@ main(int argc, char **argv)
for (i = 0; i < NOP; i++) {
op = op_table + i;
- if (strncmp(argv[0], op->cmd, strlen(op->cmd)) == 0)
+ if (strncmp(argv[0], op->cmd, strlen(op->cmd)) == 0 ||
+ (op->alias != NULL && strcmp(argv[0], op->alias) == 0))
exit(op->fn(path, argc, argv));
}