diff --git a/CHANGES b/CHANGES index a0a62270..526060fc 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ 19 June 2008 +* Use "status" consistently for status line option, and prefix for "prefix" key + option. * Allow commands to be entered at a prompt. This is triggered with the command-prompt command, bound to : by default. * Show status messages properly, without blocking the server. @@ -509,4 +511,4 @@ (including mutt, emacs). No status bar yet and no key remapping or other customisation. -$Id: CHANGES,v 1.127 2008-06-19 20:45:15 nicm Exp $ +$Id: CHANGES,v 1.128 2008-06-19 22:04:01 nicm Exp $ diff --git a/TODO b/TODO index d324a6ba..9375d357 100644 --- a/TODO +++ b/TODO @@ -75,3 +75,6 @@ - configurable error/info display time - tidy up window modes - support \033_string\033\\ for window title too +- fix bell-action in show-window +- replace status-lines with status internally too +- list-keys should be sorted diff --git a/cmd-new-session.c b/cmd-new-session.c index 119f090b..0baa5088 100644 --- a/cmd-new-session.c +++ b/cmd-new-session.c @@ -1,4 +1,4 @@ -/* $Id: cmd-new-session.c,v 1.28 2008-06-18 16:39:15 nicm Exp $ */ +/* $Id: cmd-new-session.c,v 1.29 2008-06-19 22:04:02 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -116,7 +116,7 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx) struct client *c = ctx->cmdclient; struct session *s; char *cmd, *cause; - u_int sx, sy, slines; + u_int sx, sy; if (ctx->flags & CMD_KEY) return; @@ -148,10 +148,12 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx) sy = c->sy; } - slines = options_get_number(&global_options, "status-lines"); - if (sy < slines) - sy = slines + 1; - sy -= slines; + if (options_get_number(&global_options, "status")) { + if (sy == 0) + sy = 1; + else + sy--; + } if (!data->flag_detached && tty_open(&c->tty, &cause) != 0) { ctx->error(ctx, "%s", cause); diff --git a/cmd-send-prefix.c b/cmd-send-prefix.c index 8e010b04..955dbc12 100644 --- a/cmd-send-prefix.c +++ b/cmd-send-prefix.c @@ -1,4 +1,4 @@ -/* $Id: cmd-send-prefix.c,v 1.15 2008-06-15 08:01:54 nicm Exp $ */ +/* $Id: cmd-send-prefix.c,v 1.16 2008-06-19 22:04:02 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -49,7 +49,7 @@ cmd_send_prefix_exec(struct cmd *self, struct cmd_ctx *ctx) if ((wl = cmd_find_window(ctx, data->target, &s)) == NULL) return; - window_key(wl->window, options_get_key(&s->options, "prefix-key")); + window_key(wl->window, options_get_key(&s->options, "prefix")); if (ctx->cmdclient != NULL) server_write_client(ctx->cmdclient, MSG_EXIT, NULL, 0); diff --git a/cmd-set-option.c b/cmd-set-option.c index ec4476f7..1cbd85aa 100644 --- a/cmd-set-option.c +++ b/cmd-set-option.c @@ -1,4 +1,4 @@ -/* $Id: cmd-set-option.c,v 1.31 2008-06-18 22:21:51 nicm Exp $ */ +/* $Id: cmd-set-option.c,v 1.32 2008-06-19 22:04:02 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -148,15 +148,15 @@ cmd_set_option_exec(struct cmd *self, unused struct cmd_ctx *ctx) ctx->error(ctx, "unknown key: %s", data->value); return; } - options_set_key(oo, "prefix-key", key); + options_set_key(oo, "prefix", key); } else if (strcmp(data->option, "status") == 0) { if (flag == -1) { ctx->error(ctx, "bad value: %s", data->value); return; } if (flag == -2) - flag = !options_get_number(oo, "status-lines"); - options_set_number(oo, "status-lines", flag); + flag = !options_get_number(oo, "status"); + options_set_number(oo, "status", flag); recalculate_sizes(); } else if (strcmp(data->option, "status-fg") == 0) { if (data->value == NULL) { diff --git a/resize.c b/resize.c index 3d6b6348..ca9059de 100644 --- a/resize.c +++ b/resize.c @@ -1,4 +1,4 @@ -/* $Id: resize.c,v 1.15 2008-06-14 16:47:20 nicm Exp $ */ +/* $Id: resize.c,v 1.16 2008-06-19 22:04:02 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -48,7 +48,7 @@ recalculate_sizes(void) struct session *s; struct client *c; struct window *w; - u_int i, j, ssx, ssy, slines, has; + u_int i, j, ssx, ssy, has; for (i = 0; i < ARRAY_LENGTH(&sessions); i++) { s = ARRAY_ITEM(&sessions, i); @@ -73,10 +73,12 @@ recalculate_sizes(void) } s->flags &= ~SESSION_UNATTACHED; - slines = options_get_number(&s->options, "status-lines"); - if (ssy < slines) - ssy = slines + 1; - ssy -= slines; + if (options_get_number(&s->options, "status")) { + if (ssy == 0) + ssy = 1; + else + ssy--; + } if (s->sx == ssx && s->sy == ssy) continue; diff --git a/server.c b/server.c index a7b94186..4a7518fa 100644 --- a/server.c +++ b/server.c @@ -1,4 +1,4 @@ -/* $Id: server.c,v 1.70 2008-06-19 19:40:34 nicm Exp $ */ +/* $Id: server.c,v 1.71 2008-06-19 22:04:02 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -322,7 +322,7 @@ server_check_redraw(struct client *c) } xx = c->sx; - yy = c->sy - 1; //options_get_number(&s->options, "status-lines"); + yy = c->sy - 1; if (c->flags & CLIENT_REDRAW) { sx = screen_size_x(s->curw->window->screen); sy = screen_size_y(s->curw->window->screen); @@ -372,7 +372,7 @@ server_check_timers(struct client *c) { struct session *s; struct timespec ts, ts2; - u_int nlines, interval; + u_int interval; if (c == NULL || c->session == NULL) return; @@ -384,8 +384,7 @@ server_check_timers(struct client *c) if (c->message_string != NULL && timespeccmp(&ts, &c->message_timer, >)) server_clear_client_message(c); - nlines = options_get_number(&s->options, "status-lines"); - if (nlines == 0) + if (!options_get_number(&s->options, "status")) return; interval = options_get_number(&s->options, "status-interval"); if (interval == 0) @@ -522,7 +521,7 @@ server_handle_client(struct client *c) struct window *w = c->session->curw->window; int key, prefix; - prefix = options_get_key(&c->session->options, "prefix-key"); + prefix = options_get_key(&c->session->options, "prefix"); while (tty_keys_next(&c->tty, &key) == 0) { server_clear_client_message(c); if (c->prompt_string != NULL) { diff --git a/status.c b/status.c index b54b8394..599c53e9 100644 --- a/status.c +++ b/status.c @@ -1,4 +1,4 @@ -/* $Id: status.c,v 1.34 2008-06-19 20:53:04 nicm Exp $ */ +/* $Id: status.c,v 1.35 2008-06-19 22:04:02 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -42,8 +42,7 @@ status_redraw(struct client *c) struct tm *tm; int larrow, rarrow; - yy = options_get_number(&s->options, "status-lines"); - if (c->sy == 0 || yy == 0) + if (c->sy == 0 || !options_get_number(&s->options, "status")) goto off; larrow = rarrow = 0; @@ -51,7 +50,7 @@ status_redraw(struct client *c) fatal("clock_gettime failed"); colr = options_get_colours(&s->options, "status-colour"); - yy = c->sy - yy; + yy = c->sy - 1; if (yy == 0) goto blank; diff --git a/tmux.1 b/tmux.1 index ed14c71b..7cc5706c 100644 --- a/tmux.1 +++ b/tmux.1 @@ -1,4 +1,4 @@ -.\" $Id: tmux.1,v 1.40 2008-06-19 21:45:46 nicm Exp $ +.\" $Id: tmux.1,v 1.41 2008-06-19 22:04:02 nicm Exp $ .\" .\" Copyright (c) 2007 Nicholas Marriott .\" @@ -569,7 +569,7 @@ The default is Set the maximum number of lines held in window history. This setting applies only to new windows - existing window histories are not resized and retain the limit at the point they were created. -.It Ic prefix-key Ar key +.It Ic prefix Ar key Set the current prefix key. .It Xo Ic status .Op Ic on | Ic off diff --git a/tmux.c b/tmux.c index eb1cb467..9a26f528 100644 --- a/tmux.c +++ b/tmux.c @@ -1,4 +1,4 @@ -/* $Id: tmux.c,v 1.62 2008-06-19 19:40:35 nicm Exp $ */ +/* $Id: tmux.c,v 1.63 2008-06-19 22:04:02 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -210,11 +210,11 @@ main(int argc, char **argv) siginit(); options_init(&global_options, NULL); - options_set_number(&global_options, "status-lines", 1); + options_set_number(&global_options, "status", 1); options_set_colours(&global_options, "status-colour", 0x02); options_set_number(&global_options, "bell-action", BELL_ANY); options_set_number(&global_options, "history-limit", 2000); - options_set_key(&global_options, "prefix-key", META); + options_set_key(&global_options, "prefix", META); options_set_string(&global_options, "status-left", "%s", ""); /* ugh */ options_set_string( &global_options, "status-right", "%%H:%%M %%d-%%b-%%y");