mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	status-lines -> status, prefix-key -> prefix
This commit is contained in:
		
							
								
								
									
										4
									
								
								CHANGES
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								CHANGES
									
									
									
									
									
								
							@@ -1,5 +1,7 @@
 | 
				
			|||||||
19 June 2008
 | 
					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
 | 
					* Allow commands to be entered at a prompt. This is triggered with the
 | 
				
			||||||
  command-prompt command, bound to : by default.
 | 
					  command-prompt command, bound to : by default.
 | 
				
			||||||
* Show status messages properly, without blocking the server.
 | 
					* 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
 | 
					  (including mutt, emacs). No status bar yet and no key remapping or other
 | 
				
			||||||
  customisation.
 | 
					  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 $
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										3
									
								
								TODO
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								TODO
									
									
									
									
									
								
							@@ -75,3 +75,6 @@
 | 
				
			|||||||
- configurable error/info display time
 | 
					- configurable error/info display time
 | 
				
			||||||
- tidy up window modes
 | 
					- tidy up window modes
 | 
				
			||||||
- support \033_string\033\\ for window title too
 | 
					- 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
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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 <nicm@users.sourceforge.net>
 | 
					 * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
				
			||||||
@@ -116,7 +116,7 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx)
 | 
				
			|||||||
	struct client			*c = ctx->cmdclient;
 | 
						struct client			*c = ctx->cmdclient;
 | 
				
			||||||
	struct session			*s;
 | 
						struct session			*s;
 | 
				
			||||||
	char				*cmd, *cause;
 | 
						char				*cmd, *cause;
 | 
				
			||||||
	u_int				 sx, sy, slines;
 | 
						u_int				 sx, sy;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (ctx->flags & CMD_KEY)
 | 
						if (ctx->flags & CMD_KEY)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
@@ -148,10 +148,12 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx)
 | 
				
			|||||||
		sy = c->sy;
 | 
							sy = c->sy;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	slines = options_get_number(&global_options, "status-lines");
 | 
						if (options_get_number(&global_options, "status")) {
 | 
				
			||||||
	if (sy < slines)
 | 
							if (sy == 0)
 | 
				
			||||||
		sy = slines + 1;
 | 
								sy = 1;
 | 
				
			||||||
	sy -= slines;
 | 
							else
 | 
				
			||||||
 | 
								sy--;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!data->flag_detached && tty_open(&c->tty, &cause) != 0) {
 | 
						if (!data->flag_detached && tty_open(&c->tty, &cause) != 0) {
 | 
				
			||||||
		ctx->error(ctx, "%s", cause);
 | 
							ctx->error(ctx, "%s", cause);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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 <nicm@users.sourceforge.net>
 | 
					 * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
				
			||||||
@@ -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)
 | 
						if ((wl = cmd_find_window(ctx, data->target, &s)) == NULL)
 | 
				
			||||||
		return;
 | 
							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)
 | 
						if (ctx->cmdclient != NULL)
 | 
				
			||||||
		server_write_client(ctx->cmdclient, MSG_EXIT, NULL, 0);
 | 
							server_write_client(ctx->cmdclient, MSG_EXIT, NULL, 0);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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 <nicm@users.sourceforge.net>
 | 
					 * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
				
			||||||
@@ -148,15 +148,15 @@ cmd_set_option_exec(struct cmd *self, unused struct cmd_ctx *ctx)
 | 
				
			|||||||
			ctx->error(ctx, "unknown key: %s", data->value);
 | 
								ctx->error(ctx, "unknown key: %s", data->value);
 | 
				
			||||||
			return;
 | 
								return;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		options_set_key(oo, "prefix-key", key);
 | 
							options_set_key(oo, "prefix", key);
 | 
				
			||||||
	} else if (strcmp(data->option, "status") == 0) {
 | 
						} else if (strcmp(data->option, "status") == 0) {
 | 
				
			||||||
		if (flag == -1) {
 | 
							if (flag == -1) {
 | 
				
			||||||
			ctx->error(ctx, "bad value: %s", data->value);
 | 
								ctx->error(ctx, "bad value: %s", data->value);
 | 
				
			||||||
			return;
 | 
								return;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if (flag == -2)
 | 
							if (flag == -2)
 | 
				
			||||||
			flag = !options_get_number(oo, "status-lines");
 | 
								flag = !options_get_number(oo, "status");
 | 
				
			||||||
		options_set_number(oo, "status-lines", flag);
 | 
							options_set_number(oo, "status", flag);
 | 
				
			||||||
		recalculate_sizes();
 | 
							recalculate_sizes();
 | 
				
			||||||
	} else if (strcmp(data->option, "status-fg") == 0) {
 | 
						} else if (strcmp(data->option, "status-fg") == 0) {
 | 
				
			||||||
		if (data->value == NULL) {
 | 
							if (data->value == NULL) {
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										14
									
								
								resize.c
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								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 <nicm@users.sourceforge.net>
 | 
					 * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
				
			||||||
@@ -48,7 +48,7 @@ recalculate_sizes(void)
 | 
				
			|||||||
	struct session	*s;
 | 
						struct session	*s;
 | 
				
			||||||
	struct client	*c;
 | 
						struct client	*c;
 | 
				
			||||||
	struct window	*w;
 | 
						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++) {
 | 
						for (i = 0; i < ARRAY_LENGTH(&sessions); i++) {
 | 
				
			||||||
		s = ARRAY_ITEM(&sessions, i);
 | 
							s = ARRAY_ITEM(&sessions, i);
 | 
				
			||||||
@@ -73,10 +73,12 @@ recalculate_sizes(void)
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
		s->flags &= ~SESSION_UNATTACHED;
 | 
							s->flags &= ~SESSION_UNATTACHED;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		slines = options_get_number(&s->options, "status-lines");
 | 
							if (options_get_number(&s->options, "status")) {
 | 
				
			||||||
		if (ssy < slines)
 | 
								if (ssy == 0)
 | 
				
			||||||
			ssy = slines + 1;
 | 
									ssy = 1;
 | 
				
			||||||
		ssy -= slines;
 | 
								else
 | 
				
			||||||
 | 
									ssy--;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		if (s->sx == ssx && s->sy == ssy)
 | 
							if (s->sx == ssx && s->sy == ssy)
 | 
				
			||||||
			continue;
 | 
								continue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										11
									
								
								server.c
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								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 <nicm@users.sourceforge.net>
 | 
					 * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
				
			||||||
@@ -322,7 +322,7 @@ server_check_redraw(struct client *c)
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	xx = c->sx;
 | 
						xx = c->sx;
 | 
				
			||||||
	yy = c->sy - 1; //options_get_number(&s->options, "status-lines");
 | 
						yy = c->sy - 1;
 | 
				
			||||||
	if (c->flags & CLIENT_REDRAW) {
 | 
						if (c->flags & CLIENT_REDRAW) {
 | 
				
			||||||
		sx = screen_size_x(s->curw->window->screen);
 | 
							sx = screen_size_x(s->curw->window->screen);
 | 
				
			||||||
		sy = screen_size_y(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 session	*s;
 | 
				
			||||||
	struct timespec	 ts, ts2;
 | 
						struct timespec	 ts, ts2;
 | 
				
			||||||
	u_int		 nlines, interval;
 | 
						u_int		 interval;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (c == NULL || c->session == NULL)
 | 
						if (c == NULL || c->session == NULL)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
@@ -384,8 +384,7 @@ server_check_timers(struct client *c)
 | 
				
			|||||||
	if (c->message_string != NULL && timespeccmp(&ts, &c->message_timer, >))
 | 
						if (c->message_string != NULL && timespeccmp(&ts, &c->message_timer, >))
 | 
				
			||||||
		server_clear_client_message(c);
 | 
							server_clear_client_message(c);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	nlines = options_get_number(&s->options, "status-lines");
 | 
						if (!options_get_number(&s->options, "status"))
 | 
				
			||||||
	if (nlines == 0)
 | 
					 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	interval = options_get_number(&s->options, "status-interval");
 | 
						interval = options_get_number(&s->options, "status-interval");
 | 
				
			||||||
	if (interval == 0)
 | 
						if (interval == 0)
 | 
				
			||||||
@@ -522,7 +521,7 @@ server_handle_client(struct client *c)
 | 
				
			|||||||
	struct window	*w = c->session->curw->window;
 | 
						struct window	*w = c->session->curw->window;
 | 
				
			||||||
	int		 key, prefix;
 | 
						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) {
 | 
						while (tty_keys_next(&c->tty, &key) == 0) {
 | 
				
			||||||
		server_clear_client_message(c);
 | 
							server_clear_client_message(c);
 | 
				
			||||||
		if (c->prompt_string != NULL) {
 | 
							if (c->prompt_string != NULL) {
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										7
									
								
								status.c
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								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 <nicm@users.sourceforge.net>
 | 
					 * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
				
			||||||
@@ -42,8 +42,7 @@ status_redraw(struct client *c)
 | 
				
			|||||||
	struct tm		       *tm;
 | 
						struct tm		       *tm;
 | 
				
			||||||
	int				larrow, rarrow;
 | 
						int				larrow, rarrow;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	yy = options_get_number(&s->options, "status-lines");
 | 
						if (c->sy == 0 || !options_get_number(&s->options, "status"))
 | 
				
			||||||
	if (c->sy == 0 || yy == 0)
 | 
					 | 
				
			||||||
		goto off;
 | 
							goto off;
 | 
				
			||||||
	larrow = rarrow = 0;
 | 
						larrow = rarrow = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -51,7 +50,7 @@ status_redraw(struct client *c)
 | 
				
			|||||||
		fatal("clock_gettime failed");
 | 
							fatal("clock_gettime failed");
 | 
				
			||||||
	colr = options_get_colours(&s->options, "status-colour");
 | 
						colr = options_get_colours(&s->options, "status-colour");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	yy = c->sy - yy;
 | 
						yy = c->sy - 1;
 | 
				
			||||||
	if (yy == 0)
 | 
						if (yy == 0)
 | 
				
			||||||
		goto blank;
 | 
							goto blank;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										4
									
								
								tmux.1
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								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 <nicm@users.sourceforge.net>
 | 
					.\" Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
				
			||||||
.\"
 | 
					.\"
 | 
				
			||||||
@@ -569,7 +569,7 @@ The default is
 | 
				
			|||||||
Set the maximum number of lines held in window history.
 | 
					Set the maximum number of lines held in window history.
 | 
				
			||||||
This setting applies only to new windows - existing window histories are not
 | 
					This setting applies only to new windows - existing window histories are not
 | 
				
			||||||
resized and retain the limit at the point they were created.
 | 
					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.
 | 
					Set the current prefix key.
 | 
				
			||||||
.It Xo Ic status
 | 
					.It Xo Ic status
 | 
				
			||||||
.Op Ic on | Ic off
 | 
					.Op Ic on | Ic off
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										6
									
								
								tmux.c
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								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 <nicm@users.sourceforge.net>
 | 
					 * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
				
			||||||
@@ -210,11 +210,11 @@ main(int argc, char **argv)
 | 
				
			|||||||
	siginit();
 | 
						siginit();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	options_init(&global_options, NULL);
 | 
						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_colours(&global_options, "status-colour", 0x02);
 | 
				
			||||||
	options_set_number(&global_options, "bell-action", BELL_ANY);
 | 
						options_set_number(&global_options, "bell-action", BELL_ANY);
 | 
				
			||||||
	options_set_number(&global_options, "history-limit", 2000);
 | 
						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-left", "%s", ""); /* ugh */
 | 
				
			||||||
	options_set_string(
 | 
						options_set_string(
 | 
				
			||||||
	    &global_options, "status-right", "%%H:%%M %%d-%%b-%%y");
 | 
						    &global_options, "status-right", "%%H:%%M %%d-%%b-%%y");
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user