display-time option to set message display time.

pull/1/head
Nicholas Marriott 2008-06-19 23:20:45 +00:00
parent 7cebf4768b
commit a1db273dc2
4 changed files with 30 additions and 5 deletions

View File

@ -1,3 +1,8 @@
20 June 2008
* New option, display-time, sets the time status line messages stay on screen
(unless a key is pressed). Set in milliseconds, default is 750 (0.75 seconds).
19 June 2008
* Use "status" consistently for status line option, and prefix for "prefix" key
@ -511,4 +516,4 @@
(including mutt, emacs). No status bar yet and no key remapping or other
customisation.
$Id: CHANGES,v 1.128 2008-06-19 22:04:01 nicm Exp $
$Id: CHANGES,v 1.129 2008-06-19 23:20:45 nicm Exp $

View File

@ -1,4 +1,4 @@
/* $Id: cmd-set-option.c,v 1.32 2008-06-19 22:04:02 nicm Exp $ */
/* $Id: cmd-set-option.c,v 1.33 2008-06-19 23:20:45 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -236,6 +236,20 @@ cmd_set_option_exec(struct cmd *self, unused struct cmd_ctx *ctx)
return;
}
options_set_number(oo, "history-limit", number);
} else if (strcmp(data->option, "display-time") == 0) {
if (data->value == NULL || number == -1) {
ctx->error(ctx, "invalid value");
return;
}
if (errstr != NULL) {
ctx->error(ctx, "display-time %s", errstr);
return;
}
if (number > INT_MAX) {
ctx->error(ctx, "display-time too big: %u", number);
return;
}
options_set_number(oo, "display-time", number);
} else if (strcmp(data->option, "status-left") == 0) {
if (data->value == NULL) {
ctx->error(ctx, "invalid value");

View File

@ -1,4 +1,4 @@
/* $Id: server-fn.c,v 1.46 2008-06-19 23:07:11 nicm Exp $ */
/* $Id: server-fn.c,v 1.47 2008-06-19 23:20:45 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -26,7 +26,12 @@
void
server_set_client_message(struct client *c, const char *msg)
{
struct timespec ts = { 0, 750000000L };
struct timespec ts;
int delay;
delay = options_get_number(&c->session->options, "display-time");
ts.tv_sec = delay / 1000;
ts.tv_nsec = (delay % 1000) * 1000000L;
c->message_string = xstrdup(msg);
if (clock_gettime(CLOCK_REALTIME, &c->message_timer) != 0)

3
tmux.c
View File

@ -1,4 +1,4 @@
/* $Id: tmux.c,v 1.63 2008-06-19 22:04:02 nicm Exp $ */
/* $Id: tmux.c,v 1.64 2008-06-19 23:20:45 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -214,6 +214,7 @@ main(int argc, char **argv)
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_number(&global_options, "display-time", 750);
options_set_key(&global_options, "prefix", META);
options_set_string(&global_options, "status-left", "%s", ""); /* ugh */
options_set_string(