diff options
66 files changed, 418 insertions, 416 deletions
@@ -125,7 +125,7 @@ client_send_identify(int flags) if (getcwd(data.cwd, sizeof data.cwd) == NULL) *data.cwd = '\0'; - + term = getenv("TERM"); if (term == NULL || strlcpy(data.term, term, sizeof data.term) >= sizeof data.term) @@ -143,7 +143,7 @@ client_send_environ(void) struct msg_environ_data data; char **var; - for (var = environ; *var != NULL; var++) { + for (var = environ; *var != NULL; var++) { if (strlcpy(data.var, *var, sizeof data.var) >= sizeof data.var) continue; client_write_server(MSG_ENVIRON, &data, sizeof data); @@ -153,7 +153,7 @@ client_send_environ(void) void client_write_server(enum msgtype type, void *buf, size_t len) { - imsg_compose(&client_ibuf, type, PROTOCOL_VERSION, -1, -1, buf, len); + imsg_compose(&client_ibuf, type, PROTOCOL_VERSION, -1, -1, buf, len); } void @@ -179,7 +179,7 @@ client_main(void) /* Note: event_init() has already been called. */ - /* Set up signals. */ + /* Set up signals. */ memset(&sigact, 0, sizeof sigact); sigemptyset(&sigact.sa_mask); sigact.sa_flags = SA_RESTART; @@ -263,9 +263,9 @@ client_callback(unused int fd, short events, unused void *data) if (client_dispatch() != 0) { event_loopexit(NULL); return; - } + } } - + if (events & EV_WRITE) { if (msgbuf_write(&client_ibuf.w) < 0) goto lost_server; @@ -341,7 +341,7 @@ client_dispatch(void) if (datalen != sizeof lockdata) fatalx("bad MSG_LOCK size"); memcpy(&lockdata, imsg.data, sizeof lockdata); - + lockdata.cmd[(sizeof lockdata.cmd) - 1] = '\0'; system(lockdata.cmd); client_write_server(MSG_UNLOCK, NULL, 0); @@ -134,13 +134,13 @@ clock_draw(struct screen_write_ctx *ctx, int colour, int style) for (ptr = tim; *ptr != '\0'; ptr++) { if (*ptr >= '0' && *ptr <= '9') idx = *ptr - '0'; - else if (*ptr == ':') + else if (*ptr == ':') idx = 10; - else if (*ptr == 'A') + else if (*ptr == 'A') idx = 11; - else if (*ptr == 'P') + else if (*ptr == 'P') idx = 12; - else if (*ptr == 'M') + else if (*ptr == 'M') idx = 13; else { x += 6; diff --git a/cmd-attach-session.c b/cmd-attach-session.c index be7adb3f..c8f01633 100644 --- a/cmd-attach-session.c +++ b/cmd-attach-session.c @@ -29,7 +29,7 @@ int cmd_attach_session_exec(struct cmd *, struct cmd_ctx *); const struct cmd_entry cmd_attach_session_entry = { "attach-session", "attach", "[-d] " CMD_TARGET_SESSION_USAGE, - CMD_CANTNEST|CMD_STARTSERVER|CMD_SENDENVIRON, "d", + CMD_CANTNEST|CMD_STARTSERVER|CMD_SENDENVIRON, "d", cmd_target_init, cmd_target_parse, cmd_attach_session_exec, @@ -59,7 +59,7 @@ cmd_attach_session_exec(struct cmd *self, struct cmd_ctx *ctx) if (ctx->cmdclient == NULL) { if (cmd_check_flag(data->chflags, 'd')) { - /* + /* * Can't use server_write_session in case attaching to * the same session as currently attached to. */ @@ -72,7 +72,7 @@ cmd_attach_session_exec(struct cmd *self, struct cmd_ctx *ctx) server_write_client(c, MSG_DETACH, NULL, 0); } } - + ctx->curclient->session = s; server_redraw_client(ctx->curclient); } else { diff --git a/cmd-bind-key.c b/cmd-bind-key.c index eba5125b..4ed84ac3 100644 --- a/cmd-bind-key.c +++ b/cmd-bind-key.c @@ -152,7 +152,7 @@ cmd_bind_key_table(struct cmd *self, struct cmd_ctx *ctx) ctx->error(ctx, "unknown command: %s", data->modecmd); return (-1); } - + mtmp.key = data->key & ~KEYC_PREFIX; mtmp.mode = data->command_key ? 1 : 0; if ((mbind = SPLAY_FIND(mode_key_tree, mtab->tree, &mtmp)) != NULL) { diff --git a/cmd-break-pane.c b/cmd-break-pane.c index d465f602..d5f847fb 100644 --- a/cmd-break-pane.c +++ b/cmd-break-pane.c @@ -64,18 +64,18 @@ cmd_break_pane_exec(struct cmd *self, struct cmd_ctx *ctx) if (wl->window->active == NULL) wl->window->active = TAILQ_NEXT(wp, entry); } - layout_close_pane(wp); + layout_close_pane(wp); - w = wp->window = window_create1(s->sx, s->sy); - TAILQ_INSERT_HEAD(&w->panes, wp, entry); - w->active = wp; - w->name = default_window_name(w); + w = wp->window = window_create1(s->sx, s->sy); + TAILQ_INSERT_HEAD(&w->panes, wp, entry); + w->active = wp; + w->name = default_window_name(w); layout_init(w); base_idx = options_get_number(&s->options, "base-index"); - wl = session_attach(s, w, -1 - base_idx, &cause); /* can't fail */ - if (!cmd_check_flag(data->chflags, 'd')) - session_select(s, wl->idx); + wl = session_attach(s, w, -1 - base_idx, &cause); /* can't fail */ + if (!cmd_check_flag(data->chflags, 'd')) + session_select(s, wl->idx); server_redraw_session(s); server_status_session_group(s); diff --git a/cmd-capture-pane.c b/cmd-capture-pane.c index 7444b90c..4909531d 100644 --- a/cmd-capture-pane.c +++ b/cmd-capture-pane.c @@ -48,7 +48,7 @@ cmd_capture_pane_exec(struct cmd *self, struct cmd_ctx *ctx) struct screen *s; struct session *sess; u_int i, limit; - size_t len, linelen; + size_t len, linelen; if (cmd_find_pane(ctx, data->target, &sess, &wp) == NULL) return (-1); diff --git a/cmd-choose-window.c b/cmd-choose-window.c index a1540f1d..18b08751 100644 --- a/cmd-choose-window.c +++ b/cmd-choose-window.c @@ -116,10 +116,10 @@ cmd_choose_window_exec(struct cmd *self, struct cmd_ctx *ctx) cdata->client = ctx->curclient; cdata->client->references++; - window_choose_ready(wl->window->active, + window_choose_ready(wl->window->active, cur, cmd_choose_window_callback, cmd_choose_window_free, cdata); - return (0); + return (0); } void @@ -133,7 +133,7 @@ cmd_choose_window_callback(void *data, int idx) if (idx == -1) return; if (cdata->client->flags & CLIENT_DEAD) - return; + return; if (cdata->session->flags & SESSION_DEAD) return; if (cdata->client->session != cdata->session) diff --git a/cmd-generic.c b/cmd-generic.c index 9961c19f..8b536fa0 100644 --- a/cmd-generic.c +++ b/cmd-generic.c @@ -141,7 +141,7 @@ cmd_fill_argument(int flags, char **arg, char **arg2, int argc, char **argv) if (argc == 2) *arg2 = xstrdup(argv[1]); return (0); - } + } if (argc != 0) return (-1); @@ -225,9 +225,9 @@ cmd_target_print(struct cmd *self, char *buf, size_t len) off += cmd_print_flags(buf, len, off, data->chflags); if (off < len && data->target != NULL) off += cmd_prarg(buf + off, len - off, " -t ", data->target); - if (off < len && data->arg != NULL) + if (off < len && data->arg != NULL) off += cmd_prarg(buf + off, len - off, " ", data->arg); - if (off < len && data->arg2 != NULL) + if (off < len && data->arg2 != NULL) off += cmd_prarg(buf + off, len - off, " ", data->arg2); return (off); } @@ -317,9 +317,9 @@ cmd_srcdst_print(struct cmd *self, char *buf, size_t len) off += xsnprintf(buf + off, len - off, " -s %s", data->src); if (off < len && data->dst != NULL) off += xsnprintf(buf + off, len - off, " -t %s", data->dst); - if (off < len && data->arg != NULL) + if (off < len && data->arg != NULL) off += cmd_prarg(buf + off, len - off, " ", data->arg); - if (off < len && data->arg2 != NULL) + if (off < len && data->arg2 != NULL) off += cmd_prarg(buf + off, len - off, " ", data->arg2); return (off); } @@ -415,9 +415,9 @@ cmd_buffer_print(struct cmd *self, char *buf, size_t len) off += xsnprintf(buf + off, len - off, " -b %d", data->buffer); if (off < len && data->target != NULL) off += cmd_prarg(buf + off, len - off, " -t ", data->target); - if (off < len && data->arg != NULL) + if (off < len && data->arg != NULL) off += cmd_prarg(buf + off, len - off, " ", data->arg); - if (off < len && data->arg2 != NULL) + if (off < len && data->arg2 != NULL) off += cmd_prarg(buf + off, len - off, " ", data->arg2); return (off); } diff --git a/cmd-kill-session.c b/cmd-kill-session.c index ff0b95e3..26331b79 100644 --- a/cmd-kill-session.c +++ b/cmd-kill-session.c @@ -45,7 +45,7 @@ cmd_kill_session_exec(struct cmd *self, struct cmd_ctx *ctx) { struct cmd_target_data *data = self->data; struct session *s; - struct client *c; + struct client *c; u_int i; if ((s = cmd_find_session(ctx, data->target)) == NULL) diff --git a/cmd-list-buffers.c b/cmd-list-buffers.c index 30235295..0416dfe7 100644 --- a/cmd-list-buffers.c +++ b/cmd-list-buffers.c @@ -71,7 +71,7 @@ cmd_list_buffers_exec(struct cmd *self, struct cmd_ctx *ctx) tmp[50 - 3] = '\0'; strlcat(tmp, "...", sizeof tmp); } - + ctx->print(ctx, "%u: %zu bytes: \"%s\"", idx - 1, size, tmp); } diff --git a/cmd-list-keys.c b/cmd-list-keys.c index 13785fac..d41f890b 100644 --- a/cmd-list-keys.c +++ b/cmd-list-keys.c @@ -75,7 +75,7 @@ cmd_list_keys_exec(struct cmd *self, struct cmd_ctx *ctx) if (used >= sizeof tmp) continue; - if (!(bd->key & KEYC_PREFIX)) { + if (!(bd->key & KEYC_PREFIX)) { used = strlcat(tmp, "(no prefix) ", sizeof tmp); if (used >= sizeof tmp) continue; diff --git a/cmd-list-panes.c b/cmd-list-panes.c index 112a2835..ffb89787 100644 --- a/cmd-list-panes.c +++ b/cmd-list-panes.c @@ -23,7 +23,7 @@ #include "tmux.h" /* - * List panes on given window.. + * List panes on given window. */ int cmd_list_panes_exec(struct cmd *, struct cmd_ctx *); @@ -56,7 +56,7 @@ cmd_list_panes_exec(struct cmd *self, struct cmd_ctx *ctx) n = 0; TAILQ_FOREACH(wp, &wl->window->panes, entry) { gd = wp->base.grid; - + size = 0; for (i = 0; i < gd->hsize; i++) { gl = &gd->linedata[i]; @@ -64,7 +64,7 @@ cmd_list_panes_exec(struct cmd *self, struct cmd_ctx *ctx) size += gl->utf8size * sizeof *gl->utf8data; } size += gd->hsize * sizeof *gd->linedata; - + ctx->print(ctx, "%u: [%ux%u] [history %u/%u, %llu bytes]", n, wp->sx, wp->sy, gd->hsize, gd->hlimit, size); n++; diff --git a/cmd-new-session.c b/cmd-new-session.c index 25a054bc..461e0391 100644 --- a/cmd-new-session.c +++ b/cmd-new-session.c @@ -184,8 +184,8 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx) ctx->error(ctx, "not a terminal"); return (-1); } - - overrides = + + overrides = options_get_string(&global_s_options, "terminal-overrides"); if (tty_open(&ctx->cmdclient->tty, overrides, &cause) != 0) { ctx->error(ctx, "open terminal failed: %s", cause); @@ -267,13 +267,13 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx) * Set the client to the new session. If a command client exists, it is * taking this session and needs to get MSG_READY and stay around. */ - if (!detached) { + if (!detached) { if (ctx->cmdclient != NULL) { server_write_client(ctx->cmdclient, MSG_READY, NULL, 0); - ctx->cmdclient->session = s; + ctx->cmdclient->session = s; server_redraw_client(ctx->cmdclient); } else { - ctx->curclient->session = s; + ctx->curclient->session = s; server_redraw_client(ctx->curclient); } } diff --git a/cmd-new-window.c b/cmd-new-window.c index 4cba8883..d7b59b8b 100644 --- a/cmd-new-window.c +++ b/cmd-new-window.c @@ -166,7 +166,7 @@ cmd_new_window_exec(struct cmd *self, struct cmd_ctx *ctx) if (!data->flag_detached) { session_select(s, wl->idx); server_redraw_session_group(s); - } else + } else server_status_session_group(s); return (0); diff --git a/cmd-paste-buffer.c b/cmd-paste-buffer.c index 7d13ae0a..1abf09a7 100644 --- a/cmd-paste-buffer.c +++ b/cmd-paste-buffer.c @@ -78,7 +78,7 @@ cmd_paste_buffer_exec(struct cmd *self, struct cmd_ctx *ctx) paste_free_index(&s->buffers, data->buffer); } - return (0); + return (0); } /* Add bytes to a buffer but change every '\n' to '\r'. */ diff --git a/cmd-pipe-pane.c b/cmd-pipe-pane.c index a88d7ea8..efe79a38 100644 --- a/cmd-pipe-pane.c +++ b/cmd-pipe-pane.c @@ -87,7 +87,7 @@ cmd_pipe_pane_exec(struct cmd *self, struct cmd_ctx *ctx) switch (fork()) { case -1: ctx->error(ctx, "fork error: %s", strerror(errno)); - return (-1); + return (-1); case 0: /* Child process. */ close(pipe_fd[0]); @@ -114,17 +114,17 @@ cmd_pipe_pane_exec(struct cmd *self, struct cmd_ctx *ctx) wp->pipe_fd = pipe_fd[0]; wp->pipe_off = EVBUFFER_LENGTH(wp->event->input); - + wp->pipe_event = bufferevent_new(wp->pipe_fd, NULL, NULL, cmd_pipe_pane_error_callback, wp); bufferevent_enable(wp->pipe_event, EV_WRITE); - + if ((mode = fcntl(wp->pipe_fd, F_GETFL)) == -1) fatal("fcntl failed"); if (fcntl(wp->pipe_fd, F_SETFL, mode|O_NONBLOCK) == -1) fatal("fcntl failed"); if (fcntl(wp->pipe_fd, F_SETFD, FD_CLOEXEC) == -1) - fatal("fcntl failed"); + fatal("fcntl failed"); return (0); } } diff --git a/cmd-previous-layout.c b/cmd-previous-layout.c index 083ac3e9..77e3ebbb 100644 --- a/cmd-previous-layout.c +++ b/cmd-previous-layout.c @@ -43,7 +43,7 @@ cmd_previous_layout_exec(struct cmd *self, struct cmd_ctx *ctx) struct cmd_target_data *data = self->data; struct winlink *wl; u_int layout; - + if ((wl = cmd_find_window(ctx, data->target, NULL)) == NULL) return (-1); diff --git a/cmd-resize-pane.c b/cmd-resize-pane.c index e8d77176..73a5f820 100644 --- a/cmd-resize-pane.c +++ b/cmd-resize-pane.c @@ -56,7 +56,7 @@ cmd_resize_pane_init(struct cmd *self, int key) cmd_set_flag(&data->chflags, 'L'); if (key == (KEYC_RIGHT | KEYC_CTRL)) cmd_set_flag(&data->chflags, 'R'); - + if (key == (KEYC_UP | KEYC_ESCAPE)) { cmd_set_flag(&data->chflags, 'U'); data->arg = xstrdup("5"); diff --git a/cmd-respawn-window.c b/cmd-respawn-window.c index 2810ea6c..4c8235e7 100644 --- a/cmd-respawn-window.c +++ b/cmd-respawn-window.c @@ -72,7 +72,7 @@ cmd_respawn_window_exec(struct cmd *self, struct cmd_ctx *ctx) wp = TAILQ_FIRST(&w->panes); TAILQ_REMOVE(&w->panes, wp, entry); layout_free(w); - window_destroy_panes(w); + window_destroy_panes(w); TAILQ_INSERT_HEAD(&w->panes, wp, entry); window_pane_resize(wp, w->sx, w->sy); if (window_pane_spawn( diff --git a/cmd-select-layout.c b/cmd-select-layout.c index 0dc126f4..2988a44f 100644 --- a/cmd-select-layout.c +++ b/cmd-select-layout.c @@ -52,7 +52,7 @@ cmd_select_layout_init(struct cmd *self, int key) break; case ('2' | KEYC_ESCAPE): data->arg = xstrdup("even-vertical"); - break; + break; case ('3' | KEYC_ESCAPE): data->arg = xstrdup("main-horizontal"); break; @@ -80,7 +80,7 @@ cmd_select_layout_exec(struct cmd *self, struct cmd_ctx *ctx) ctx->error(ctx, "unknown layout or ambiguous: %s", data->arg); return (-1); } - + layout = layout_set_select(wl->window, layout); ctx->info(ctx, "arranging in: %s", layout_set_name(layout)); diff --git a/cmd-send-keys.c b/cmd-send-keys.c index 8b848e76..204d497d 100644 --- a/cmd-send-keys.c +++ b/cmd-send-keys.c @@ -33,7 +33,7 @@ size_t cmd_send_keys_print(struct cmd *, char *, size_t); struct cmd_send_keys_data { char *target; - u_int nkeys; + u_int nkeys; int *keys; }; diff --git a/cmd-server-info.c b/cmd-server-info.c index f0728608..8c85b2c3 100644 --- a/cmd-server-info.c +++ b/cmd-server-info.c @@ -94,12 +94,12 @@ cmd_server_info_exec(unused struct cmd *self, struct cmd_ctx *ctx) ctx->print(ctx, "%2d: %s (%d, %d): %s [%ux%u %s] " "[flags=0x%x/0x%x, references=%u]", i, c->tty.path, c->ibuf.fd, c->tty.fd, c->session->name, - c->tty.sx, c->tty.sy, c->tty.termname, c->flags, + c->tty.sx, c->tty.sy, c->tty.termname, c->flags, c->tty.flags, c->references); } ctx->print(ctx, "%s", ""); - ctx->print(ctx, "Sessions: [%zu/%zu]", + ctx->print(ctx, "Sessions: [%zu/%zu]", sizeof (struct grid_cell), sizeof (struct grid_utf8)); for (i = 0; i < ARRAY_LENGTH(&sessions); i++) { s = ARRAY_ITEM(&sessions, i); @@ -148,7 +148,7 @@ cmd_server_info_exec(unused struct cmd *self, struct cmd_ctx *ctx) } ctx->print(ctx, "%s", ""); - ctx->print(ctx, "Terminals:"); + ctx->print(ctx, "Terminals:"); SLIST_FOREACH(term, &tty_terms, entry) { ctx->print(ctx, "%s [references=%u, flags=0x%x]:", term->name, term->references, term->flags); @@ -180,7 +180,7 @@ cmd_server_info_exec(unused struct cmd *self, struct cmd_ctx *ctx) } ctx->print(ctx, "%s", ""); - ctx->print(ctx, "Jobs:"); + ctx->print(ctx, "Jobs:"); SLIST_FOREACH(job, &all_jobs, lentry) { ctx->print(ctx, "%s [fd=%d, pid=%d, status=%d, flags=0x%x]", job->cmd, job->fd, job->pid, job->status, job->flags); diff --git a/cmd-set-option.c b/cmd-set-option.c index e58ac7d2..0cd7dca6 100644 --- a/cmd-set-option.c +++ b/cmd-set-option.c @@ -34,17 +34,17 @@ const char *cmd_set_option_print( void cmd_set_option_string(struct cmd_ctx *, struct options *, const struct set_option_entry *, char *, int); void cmd_set_option_number(struct cmd_ctx *, - struct options *, const struct set_option_entry *, char *); + struct options *, const struct set_option_entry *, char *); void cmd_set_option_keys(struct cmd_ctx *, - struct options *, const struct set_option_entry *, char *); + struct options *, const struct set_option_entry *, char *); void cmd_set_option_colour(struct cmd_ctx *, - struct options *, const struct set_option_entry *, char *); + struct options *, const struct set_option_entry *, char *); void cmd_set_option_attributes(struct cmd_ctx *, - struct options *, const struct set_option_entry *, char *); + struct options *, const struct set_option_entry *, char *); void cmd_set_option_flag(struct cmd_ctx *, - struct options *, const struct set_option_entry *, char *); + struct options *, const struct set_option_entry *, char *); void cmd_set_option_choice(struct cmd_ctx *, - struct options *, const struct set_option_entry *, char *); + struct options *, const struct set_option_entry *, char *); const struct cmd_entry cmd_set_option_entry = { "set-option", "set", @@ -103,7 +103,7 @@ const struct set_option_entry set_session_option_table[] = { { "status-bg", SET_OPTION_COLOUR, 0, 0, NULL }, { "status-fg", SET_OPTION_COLOUR, 0, 0, NULL }, { "status-interval", SET_OPTION_NUMBER, 0, INT_MAX, NULL }, - { "status-justify", + { "status-justify", SET_OPTION_CHOICE, 0, 0, set_option_status_justify_list }, { "status-keys", SET_OPTION_CHOICE, 0, 0, set_option_status_keys_list }, { "status-left", SET_OPTION_STRING, 0, 0, NULL }, @@ -116,11 +116,11 @@ const struct set_option_entry set_session_option_table[] = { { "status-right-bg", SET_OPTION_COLOUR, 0, 0, NULL }, { "status-right-fg", SET_OPTION_COLOUR, 0, 0, NULL }, { "status-right-length", SET_OPTION_NUMBER, 0, SHRT_MAX, NULL }, - { "status-utf8", SET_OPTION_FLAG, 0, 0, NULL }, < |