The branch, master has been updated via c04aa9020782fe0a944db2adf5a03e9f52618bea (commit) via 0679eb6a6d6bab129264784009e70333b34ca6a8 (commit) via 9a7e5bd1d30ab60ef6cebfedfbdb37c6a05e9bcb (commit) via 827b311c8172f3543f9c38dc1d7740bba1d9aeaa (commit) from e4679172e3f4307b14f0e1715dc33ca640dc038b (commit)
- Log ----------------------------------------------------------------- commit c04aa9020782fe0a944db2adf5a03e9f52618bea Merge: e467917 0679eb6 Author: Thomas Adam <tho...@xteddy.org> Commit: Thomas Adam <tho...@xteddy.org> Merge branch 'obsd-master' Sync from OpenBSD. * obsd-master: Add halfpage commands to mode command string table (missed by accident), from Thomas Adam. Clarify some points about config files, notably that they are only read at server start. From Thomas Adam. Use a utility function for common code to show errors in config file, from Thomas Adam. cfg.c | 22 ++++++++++++++++++++++ cmd-new-session.c | 16 +++------------- mode-key.c | 2 ++ server.c | 21 +++++---------------- tmux.1 | 10 ++++++++-- tmux.h | 1 + 6 files changed, 41 insertions(+), 31 deletions(-) commit 0679eb6a6d6bab129264784009e70333b34ca6a8 Author: Nicholas Marriott <n...@openbsd.org> Commit: Nicholas Marriott <n...@openbsd.org> Add halfpage commands to mode command string table (missed by accident), from Thomas Adam. --- mode-key.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/mode-key.c b/mode-key.c index eae405e..821f1ef 100644 --- a/mode-key.c +++ b/mode-key.c @@ -105,6 +105,8 @@ const struct mode_key_cmdstr mode_key_cmdstr_copy[] = { { MODEKEYCOPY_DOWN, "cursor-down" }, { MODEKEYCOPY_ENDOFLINE, "end-of-line" }, { MODEKEYCOPY_GOTOLINE, "goto-line" }, + { MODEKEYCOPY_HALFPAGEDOWN, "halfpage-down" }, + { MODEKEYCOPY_HALFPAGEUP, "halfpage-up" }, { MODEKEYCOPY_HISTORYBOTTOM, "history-bottom" }, { MODEKEYCOPY_HISTORYTOP, "history-top" }, { MODEKEYCOPY_JUMP, "jump-forward" }, commit 9a7e5bd1d30ab60ef6cebfedfbdb37c6a05e9bcb Author: Nicholas Marriott <n...@openbsd.org> Commit: Nicholas Marriott <n...@openbsd.org> Clarify some points about config files, notably that they are only read at server start. From Thomas Adam. --- tmux.1 | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tmux.1 b/tmux.1 index c5c45b7..4bf5544 100644 --- a/tmux.1 +++ b/tmux.1 @@ -124,13 +124,19 @@ loads the system configuration file from .Pa /etc/tmux.conf , if present, then looks for a user configuration file at .Pa ~/.tmux.conf . +.Pp The configuration file is a set of .Nm commands which are executed in sequence when the server is first started. +.Nm +loads configuration files once when the server process has started. +The +.Ic source-file +command may be used to load a file later. .Pp -If a command in the configuration file fails, .Nm -will report an error and exit without executing further commands. +shows any error messages from commands in configuration files in the first +session created, and continues to process the rest of the configuration file. .It Fl L Ar socket-name .Nm stores the server socket in a directory under commit 827b311c8172f3543f9c38dc1d7740bba1d9aeaa Author: Nicholas Marriott <n...@openbsd.org> Commit: Nicholas Marriott <n...@openbsd.org> Use a utility function for common code to show errors in config file, from Thomas Adam. --- cfg.c | 22 ++++++++++++++++++++++ cmd-new-session.c | 16 +++------------- server.c | 21 +++++---------------- tmux.h | 1 + 4 files changed, 31 insertions(+), 29 deletions(-) diff --git a/cfg.c b/cfg.c index ead9981..ae7d9a3 100644 --- a/cfg.c +++ b/cfg.c @@ -173,3 +173,25 @@ load_cfg(const char *path, struct cmd_ctx *ctxin, struct causelist *causes) return (retval); } + +void +show_cfg_causes(struct session *s) +{ + struct window_pane *wp; + char *cause; + u_int i; + + if (s == NULL || ARRAY_EMPTY(&cfg_causes)) + return; + + wp = s->curw->window->active; + + window_pane_set_mode(wp, &window_copy_mode); + window_copy_init_for_output(wp); + for (i = 0; i < ARRAY_LENGTH(&cfg_causes); i++) { + cause = ARRAY_ITEM(&cfg_causes, i); + window_copy_add(wp, "%s", cause); + free(cause); + } + ARRAY_FREE(&cfg_causes); +} diff --git a/cmd-new-session.c b/cmd-new-session.c index cd1bc2b..0fcea35 100644 --- a/cmd-new-session.c +++ b/cmd-new-session.c @@ -58,14 +58,13 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx) struct args *args = self->args; struct session *s, *old_s, *groupwith; struct window *w; - struct window_pane *wp; struct environ env; struct termios tio, *tiop; struct passwd *pw; const char *newname, *target, *update, *cwd, *errstr; char *cmd, *cause; int detached, idx; - u_int sx, sy, i; + u_int sx, sy; newname = args_get(args, 's'); if (newname != NULL) { @@ -257,17 +256,8 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx) * If there are still configuration file errors to display, put the new * session's current window into more mode and display them now. */ - if (cfg_finished && !ARRAY_EMPTY(&cfg_causes)) { - wp = s->curw->window->active; - window_pane_set_mode(wp, &window_copy_mode); - window_copy_init_for_output(wp); - for (i = 0; i < ARRAY_LENGTH(&cfg_causes); i++) { - cause = ARRAY_ITEM(&cfg_causes, i); - window_copy_add(wp, "%s", cause); - free(cause); - } - ARRAY_FREE(&cfg_causes); - } + if (cfg_finished) + show_cfg_causes(s); return (detached ? CMD_RETURN_NORMAL : CMD_RETURN_ATTACH); } diff --git a/server.c b/server.c index 740f71d..bad2227 100644 --- a/server.c +++ b/server.c @@ -106,11 +106,8 @@ server_create_socket(void) int server_start(int lockfd, char *lockfile) { - struct window_pane *wp; - int pair[2]; - char *cause; - struct timeval tv; - u_int i; + int pair[2]; + struct timeval tv; /* The first client is special and gets a socketpair; create it. */ if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, pair) != 0) @@ -178,17 +175,9 @@ server_start(int lockfd, char *lockfile) * If there is a session already, put the current window and pane into * more mode. */ - if (!RB_EMPTY(&sessions) && !ARRAY_EMPTY(&cfg_causes)) { - wp = RB_MIN(sessions, &sessions)->curw->window->active; - window_pane_set_mode(wp, &window_copy_mode); - window_copy_init_for_output(wp); - for (i = 0; i < ARRAY_LENGTH(&cfg_causes); i++) { - cause = ARRAY_ITEM(&cfg_causes, i); - window_copy_add(wp, "%s", cause); - free(cause); - } - ARRAY_FREE(&cfg_causes); - } + if (!RB_EMPTY(&sessions) && !ARRAY_EMPTY(&cfg_causes)) + show_cfg_causes(RB_MIN(sessions, &sessions)); + cfg_finished = 1; server_add_accept(0); diff --git a/tmux.h b/tmux.h index 4a5326c..2a36c2d 100644 --- a/tmux.h +++ b/tmux.h @@ -1520,6 +1520,7 @@ extern int cfg_finished; extern struct causelist cfg_causes; void printflike2 cfg_add_cause(struct causelist *, const char *, ...); int load_cfg(const char *, struct cmd_ctx *, struct causelist *); +void show_cfg_causes(struct session *); /* format.c */ int format_cmp(struct format_entry *, struct format_entry *); ----------------------------------------------------------------------- Summary of changes: cfg.c | 22 ++++++++++++++++++++++ cmd-new-session.c | 16 +++------------- mode-key.c | 2 ++ server.c | 21 +++++---------------- tmux.1 | 10 ++++++++-- tmux.h | 1 + 6 files changed, 41 insertions(+), 31 deletions(-) hooks/post-receive -- tmux ------------------------------------------------------------------------------ Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov _______________________________________________ tmux-cvs mailing list tmux-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-cvs