diff options
| author | Thomas <thomas@xteddy.org> | 2014-02-05 10:47:57 +0000 |
|---|---|---|
| committer | Thomas <thomas@xteddy.org> | 2014-02-05 10:47:57 +0000 |
| commit | 6eef24c37a69c0faa12deb4374730cf02561c934 (patch) | |
| tree | 181937aeab92a1a9aa3c888bb1194ba1f919ec2d | |
| parent | d02c4bda3a4b456f654fb0c1b454ba9724bff0f3 (diff) | |
| parent | 57332be8da86f0e40a91d7acd857564e789027a7 (diff) | |
| download | rtmux-6eef24c37a69c0faa12deb4374730cf02561c934.tar.gz rtmux-6eef24c37a69c0faa12deb4374730cf02561c934.tar.bz2 rtmux-6eef24c37a69c0faa12deb4374730cf02561c934.zip | |
Merge branch 'master' of ssh://git.code.sf.net/p/tmux/tmux-code
| -rw-r--r-- | Makefile.am | 3 | ||||
| -rw-r--r-- | TODO | 141 | ||||
| -rw-r--r-- | cmd-kill-server.c | 14 | ||||
| -rw-r--r-- | cmd-server-info.c | 173 | ||||
| -rw-r--r-- | cmd-set-option.c | 28 | ||||
| -rw-r--r-- | cmd-show-messages.c | 111 | ||||
| -rw-r--r-- | cmd-start-server.c | 42 | ||||
| -rw-r--r-- | configure.ac | 1 | ||||
| -rw-r--r-- | grid.c | 1 | ||||
| -rw-r--r-- | input.c | 57 | ||||
| -rw-r--r-- | options-table.c | 231 | ||||
| -rw-r--r-- | options.c | 36 | ||||
| -rw-r--r-- | screen-redraw.c | 145 | ||||
| -rw-r--r-- | screen-write.c | 85 | ||||
| -rw-r--r-- | server-client.c | 6 | ||||
| -rw-r--r-- | session.c | 4 | ||||
| -rw-r--r-- | status.c | 120 | ||||
| -rw-r--r-- | style.c | 224 | ||||
| -rw-r--r-- | tmux.1 | 324 | ||||
| -rw-r--r-- | tmux.h | 40 | ||||
| -rw-r--r-- | tty.c | 3 | ||||
| -rw-r--r-- | window-choose.c | 4 | ||||
| -rw-r--r-- | window-copy.c | 41 | ||||
| -rw-r--r-- | window.c | 86 | ||||
| -rw-r--r-- | xterm-keys.c | 2 |
25 files changed, 1122 insertions, 800 deletions
diff --git a/Makefile.am b/Makefile.am index 690e466d..e5a7286e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -122,7 +122,6 @@ dist_tmux_SOURCES = \ cmd-select-pane.c \ cmd-select-window.c \ cmd-send-keys.c \ - cmd-server-info.c \ cmd-set-buffer.c \ cmd-set-environment.c \ cmd-set-option.c \ @@ -131,7 +130,6 @@ dist_tmux_SOURCES = \ cmd-show-options.c \ cmd-source-file.c \ cmd-split-window.c \ - cmd-start-server.c \ cmd-string.c \ cmd-suspend-client.c \ cmd-swap-pane.c \ @@ -175,6 +173,7 @@ dist_tmux_SOURCES = \ session.c \ signal.c \ status.c \ + style.c \ tmux.c \ tty-acs.c \ tty-keys.c \ @@ -18,14 +18,16 @@ - options bits and pieces: * set-remain-on-exit is a complete hack * way to set socket path from config file - * -fg/-bg/-attr is crap - better just foo-style options which accept - fg=,bg=,bright and so on like #[] - format improvements: * option to quote format (#{session_name:quoted}) * formats need conditions for >0 (for #P) * some way to pad # stuff with spaces, #!2T maybe * status stuff is redundant with formats + * last window update time and format for it + * formats to show if a window is linked into multiple sessions, into + multiple attached sessions, and is the active window in multiple + attached sessions? - choose mode improvements: * choose-pane command (augment choose-tree to do this?) @@ -40,105 +42,92 @@ * monitor changes within a region * perhaps monitor /all/ panes in the window not just one -- panning over window (window larger than visible) - -- link panes into multiple windows - - improve mouse support: * bind commands to mouse in different areas? * more fine-grained options * commands executed when clicking on a pattern (URL) + * send arrow key sequences for mouse scroll wheel in alternate screen + * mouse-select-pane will screw up with !MODE_MOUSE_STANDARD (it sets + the flag on w/o checking the others before calling tty_update_mode) - hooks! - warts on current naming: * display-time but message-fg/bg/attr * list-* vs show-* - * server-info * split-window -> split-pane?? -- way to keep a job running just read its last line of output for #() - - better UTF-8 support: * #22T can split in the middle of UTF-8 characters! * window names and titles * message display * prompt input * multibyte key input - -- live update: server started with -U connects to server, requests sessions and - windows, receives file descriptors - -- there are inconsistencies in what we get from old shell and what comes from - config for new sessions and windows - -- multiline status line? - -- support title stack, both internally and externally (restore on detach) - http://docs.freebsd.org/cgi/getmsg.cgi?fetch=1149299+0+archive/2010/freebsd-questions/20100207.freebsd-questions - -- last window update time and format for it - -- bind commands to key sequences -- make it so ALL keys go through a table, - first an implicit table in which C-b is the only default binding to a command - that says "next key from $othertable" and so on. means -n can go away as well + * buffer_sample and the choose-* could show UTF-8 properly - copy/paste improvements: - * case insensitive searching * incremental searching * append to buffer * paste w/o trailing whitespace * named buffers and allow gaps in the stack * command to toggle selection not to move it in copy-mode -- mouse-select-pane will screw up with !MODE_MOUSE_STANDARD (it sets the flag - on w/o checking the others before calling tty_update_mode) - -- way to tag a layout as a number/name - -- optimize pane redraws, 20120318184853.GK10965@yelena.nicm.ath.cx - -- instead of separate window and session options, just one master options list - with each option having a type (window or session), then options on window, - on session, and global. for window options we look window->session->global, - and for session we look session->global - -- maybe keep last layout + size around and if size reverts just put it back - -- way to set hints/limits about pane size for resizing - -- revamp layouts: they are too complicated, should be more closely integrated, - should support hints, layout sets should just be a special case of custom - layouts, and we should support panes that are not attached to a cell at - all. this could be the time to introduce panelink to replace layout_cell - -- use a better termcap internally instead of screen, perhaps xterm - -- use screen-256color when started on 256 colour terminal? - -- we need a tmux terminfo entry to document the extensions we are using in - upstream terminfo - -- send arrow key sequences for mouse scroll wheel when in alternate screen - -- the way pane, window, session destroy is handled is too complicated and the - distinction between session.c, window.c and server-fn.c functions is not - clear. could we just have kill_pane(), kill_window(), unlink_window(), - kill_session() that fix up all data structures (flagging sessions as dead) - and return a value to say whether clients need to be checked for dead - sessions? sort of like session_detach now but more so. or some other scheme - to make it simpler and clearer? also would be nice to remove/rename - server-fn.c +- layout stuff + * way to tag a layout as a number/name + * maybe keep last layout + size around and if size reverts just put it + back + * revamp layouts: they are too complicated, should be more closely + integrated, should support hints, layout sets should just be a + special case of custom layouts, and we should support panes that are + not attached to a cell at all. this could be the time to introduce + panelink to replace layout_cell + * way to set hints/limits about pane size for resizing + * panning over window (window larger than visible) + +- terminfo bits + * use a better termcap internally instead of screen, perhaps xterm + * use screen-256color when started on 256 colour terminal? + * need a tmux terminfo entry to document the extensions we are using in + upstream terminfo + * support title stack, both internally and externally (restore on + detach) http://docs.freebsd.org/cgi/getmsg.cgi?fetch=1149299+0+archive/2010/freebsd-questions/20100207.freebsd-questions + +- code cleanup + * instead of separate window and session options, just one master + options list with each option having a type (window or session), then + options on window, on session, and global. for window options we look + window->session->global, and for session we look session->global + * the way pane, window, session destroy is handled is too complicated + and the distinction between session.c, window.c and server-fn.c + functions is not clear. could we just have kill_pane(), + kill_window(), unlink_window(), kill_session() that fix up all data + structures (flagging sessions as dead) and return a value to say + whether clients need to be checked for dead sessions? sort of like + session_detach now but more so. or some other scheme to make it + simpler and clearer? also would be nice to remove/rename server-fn.c + * more readable way to work out the various things commands need to + know about the client, notably: + - is this the config file? (cmdq->c == NULL) + - is this a command client? (cmdq->c != NULL && + cmdq->c->session == NULL) + - is this a control client? + - can i do stdin or stdout to this client? + or even guarantee that cmdq->c != NULL and provide a better way to + tell when in the config file - then we use cmdq->c if we need a + client w/o a session else cmd_current_client + * optimize pane redraws, 20120318184853.GK10965@yelena.nicm.ath.cx + +- miscellaneous + * way to keep a job running just read its last line of output for #() + link panes into multiple windows + * live update: server started with -U connects to server, requests + sessions and windows, receives file descriptors + * there are inconsistencies in what we get from old shell and what + comes from config for new sessions and windows + * multiline status line? + * bind commands to key sequences -- make it so ALL keys go through a + table, first an implicit table in which C-b is the only default + binding to a command that says "next key from $othertable" and so + on. means -n can go away as well -- more readable way to work out the various things commands need to know about - the client, notably: - - is this the config file? (cmdq->c == NULL) - - is this a command client? (cmdq->c != NULL && cmdq->c->session == NULL) - - is this a control client? - - can i do stdin or stdout to this client? - or even guarantee that cmdq->c != NULL and provide a better way to tell when - in the config file - then we use cmdq->c if we need a client w/o a session - else cmd_current_client -- buffer_sample and the choose-* could let UTF-8 through and display it - properly. diff --git a/cmd-kill-server.c b/cmd-kill-server.c index ba63faa3..03016869 100644 --- a/cmd-kill-server.c +++ b/cmd-kill-server.c @@ -38,10 +38,20 @@ const struct cmd_entry cmd_kill_server_entry = { cmd_kill_server_exec }; +const struct cmd_entry cmd_start_server_entry = { + "start-server", "start", + "", 0, 0, + "", + CMD_STARTSERVER, + NULL, + cmd_kill_server_exec +}; + enum cmd_retval -cmd_kill_server_exec(unused struct cmd *self, unused struct cmd_q *cmdq) +cmd_kill_server_exec(struct cmd *self, unused struct cmd_q *cmdq) { - kill(getpid(), SIGTERM); + if (self->entry == &cmd_kill_server_entry) + kill(getpid(), SIGTERM); return (CMD_RETURN_NORMAL); } diff --git a/cmd-server-info.c b/cmd-server-info.c deleted file mode 100644 index 3aa5df8a..00000000 --- a/cmd-server-info.c +++ /dev/null @@ -1,173 +0,0 @@ -/* $Id$ */ - -/* - * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER - * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING - * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include <sys/types.h> -#include <sys/utsname.h> - -#include <stdlib.h> -#include <string.h> -#include <time.h> -#include <unistd.h> - -#include "tmux.h" - -/* - * Show various information about server. - */ - -enum cmd_retval cmd_server_info_exec(struct cmd *, struct cmd_q *); - -const struct cmd_entry cmd_server_info_entry = { - "server-info", "info", - "", 0, 0, - "", - 0, - NULL, - cmd_server_info_exec -}; - -enum cmd_retval -cmd_server_info_exec(unused struct cmd *self, struct cmd_q *cmdq) -{ - struct tty_term *term; - struct client *c; - struct session *s; - struct winlink *wl; - struct window *w; - struct window_pane *wp; - struct tty_code *code; - const struct tty_term_code_entry *ent; - struct utsname un; - struct job *job; - struct grid *gd; - struct grid_line *gl; - u_int i, j, k, lines; - size_t size; - char out[80]; - char *tim; - time_t t; - - tim = ctime(&start_time); - *strchr(tim, '\n') = '\0'; - cmdq_print(cmdq, - "tmux " VERSION ", pid %ld, started %s", (long) getpid(), tim); - cmdq_print(cmdq, "socket path %s, debug level %d", socket_path, - debug_level); - if (uname(&un) >= 0) { - cmdq_print(cmdq, "system is %s %s %s %s", - un.sysname, un.release, un.version, un.machine); - } - if (cfg_file != NULL) - cmdq_print(cmdq, "configuration file is %s", cfg_file); - else - cmdq_print(cmdq, "configuration file not specified"); - cmdq_print(cmdq, "protocol version is %d", PROTOCOL_VERSION); - cmdq_print(cmdq, "%s", ""); - - cmdq_print(cmdq, "Clients:"); - for (i = 0; i < ARRAY_LENGTH(&clients); i++) { - c = ARRAY_ITEM(&clients, i); - if (c == NULL || c->session == NULL) - continue; - - cmdq_print(cmdq,"%2d: %s (%d, %d): %s [%ux%u %s bs=%hho " - "class=%u] [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->tty.tio.c_cc[VERASE], c->tty.class, - c->flags, c->tty.flags, c->references); - } - cmdq_print(cmdq, "%s", ""); - - cmdq_print(cmdq, "Sessions: [%zu]", sizeof (struct grid_cell)); - RB_FOREACH(s, sessions, &sessions) { - t = s->creation_time.tv_sec; - tim = ctime(&t); - *strchr(tim, '\n') = '\0'; - - cmdq_print(cmdq, "%2u: %s: %u windows (created %s) [%ux%u] " - "[flags=0x%x]", s->id, s->name, - winlink_count(&s->windows), tim, s->sx, s->sy, s->flags); - RB_FOREACH(wl, winlinks, &s->windows) { - w = wl->window; - cmdq_print(cmdq, "%4u: %s [%ux%u] [flags=0x%x, " - "references=%u, last layout=%d]", wl->idx, w->name, - w->sx, w->sy, w->flags, w->references, - w->lastlayout); - j = 0; - TAILQ_FOREACH(wp, &w->panes, entry) { - lines = size = 0; - gd = wp->base.grid; - for (k = 0; k < gd->hsize + gd->sy; k++) { - gl = &gd->linedata[k]; - if (gl->celldata == NULL) - continue; - lines++; - size += gl->cellsize * - sizeof *gl->celldata; - } - cmdq_print(cmdq, - "%6u: %s %lu %d %u/%u, %zu bytes", j, - wp->tty, (u_long) wp->pid, wp->fd, lines, - gd->hsize + gd->sy, size); - j++; - } - } - } - cmdq_print(cmdq, "%s", ""); - - cmdq_print(cmdq, "Terminals:"); - LIST_FOREACH(term, &tty_terms, entry) { - cmdq_print(cmdq, "%s [references=%u, flags=0x%x]:", - term->name, term->references, term->flags); - for (i = 0; i < NTTYCODE; i++) { - ent = &tty_term_codes[i]; - code = &term->codes[ent->code]; - switch (code->type) { - case TTYCODE_NONE: - cmdq_print(cmdq, "%2u: %s: [missing]", - ent->code, ent->name); - break; - case TTYCODE_STRING: - strnvis(out, code->value.string, sizeof out, - VIS_OCTAL|VIS_TAB|VIS_NL); - cmdq_print(cmdq, "%2u: %s: (string) %s", - ent->code, ent->name, out); - break; - case TTYCODE_NUMBER: - cmdq_print(cmdq, "%2u: %s: (number) %d", - ent->code, ent->name, code->value.number); - break; - case TTYCODE_FLAG: - cmdq_print(cmdq, "%2u: %s: (flag) %s", - ent->code, ent->name, - code->value.flag ? "true" : "false"); - break; - } - } - } - cmdq_print(cmdq, "%s", ""); - - cmdq_print(cmdq, "Jobs:"); - LIST_FOREACH(job, &all_jobs, lentry) { - cmdq_print(cmdq, "%s [fd=%d, pid=%d, status=%d]", - job->cmd, job->fd, job->pid, job->status); - } - - return (CMD_RETURN_NORMAL); -} diff --git a/cmd-set-option.c b/cmd-set-option.c index 3acf125d..b760b045 100644 --- a/cmd-set-option.c +++ b/cmd-set-option.c @@ -60,6 +60,9 @@ struct options_entry *cmd_set_option_flag(struct cmd *, struct cmd_q *, struct options_entry *cmd_set_option_choice(struct cmd *, struct cmd_q *, const struct options_table_entry *, struct options *, const char *); +struct options_entry *cmd_set_option_style(struct cmd *, struct cmd_q *, + const struct options_table_entry *, struct options *, + const char *); const struct cmd_entry cmd_set_option_entry = { "set-option", "set", @@ -304,9 +307,11 @@ cmd_set_option_set(struct cmd *self, struct cmd_q *cmdq, break; case OPTIONS_TABLE_COLOUR: o = cmd_set_option_colour(self, cmdq, oe, oo, value); + style_update_new(oo, o->name, oe->style); break; case OPTIONS_TABLE_ATTRIBUTES: o = cmd_set_option_attributes(self, cmdq, oe, oo, value); + style_update_new(oo, o->name, oe->style); break; case OPTIONS_TABLE_FLAG: o = cmd_set_option_flag(self, cmdq, oe, oo, value); @@ -314,6 +319,9 @@ cmd_set_option_set(struct cmd *self, struct cmd_q *cmdq, case OPTIONS_TABLE_CHOICE: o = cmd_set_option_choice(self, cmdq, oe, oo, value); break; + case OPTIONS_TABLE_STYLE: + o = cmd_set_option_style(self, cmdq, oe, oo, value); + break; } if (o == NULL) return (-1); @@ -462,3 +470,23 @@ cmd_set_option_choice(unused struct cmd *self, struct cmd_q *cmdq, return (options_set_number(oo, oe->name, choice)); } + +/* Set a style option. */ +struct options_entry * +cmd_set_option_style(struct cmd *self, struct cmd_q *cmdq, + const struct options_table_entry *oe, struct options *oo, + const char *value) +{ + struct args *args = self->args; + struct options_entry *o; + int append; + + append = args_has(args, 'a'); + if ((o = options_set_style(oo, oe->name, value, append)) == NULL) { + cmdq_error(cmdq, "bad style: %s", value); + return (NULL); + } + + style_update_old(oo, oe->name, &o->style); + return (o); +} diff --git a/cmd-show-messages.c b/cmd-show-messages.c index 256570cd..0905c32e 100644 --- a/cmd-show-messages.c +++ b/cmd-show-messages.c @@ -20,6 +20,7 @@ #include <string.h> #include <time.h> +#include <unistd.h> #include "tmux.h" @@ -31,13 +32,98 @@ enum cmd_retval cmd_show_messages_exec(struct cmd *, struct cmd_q *); const struct cmd_entry cmd_show_messages_entry = { "show-messages", "showmsgs", - "t:", 0, 0, - CMD_TARGET_CLIENT_USAGE, + "IJTt:", 0, 0, + "[-IJT] " CMD_TARGET_CLIENT_USAGE, 0, NULL, cmd_show_messages_exec }; +const struct cmd_entry cmd_server_info_entry = { + "server-info", "info", + "", 0, 0, + "", + 0, + NULL, + cmd_show_messages_exec +}; + +void cmd_show_messages_server (struct cmd_q *); +void cmd_show_messages_terminals (struct cmd_q *); +void cmd_show_messages_jobs (struct cmd_q *); + +void +cmd_show_messages_server (struct cmd_q *cmdq) +{ + char *tim; + + tim = ctime(&start_time); + *strchr(tim, '\n') = '\0'; + + cmdq_print(cmdq, "started %s", tim); + cmdq_print(cmdq, "socket path %s", socket_path); + cmdq_print(cmdq, "debug level %d", debug_level); + cmdq_print(cmdq, "protocol version %d", PROTOCOL_VERSION); +} + +void +cmd_show_messages_terminals (struct cmd_q *cmdq) +{ + struct tty_term *term; + const struct tty_term_code_entry *ent; + struct tty_code *code; + u_int i, n; + char out[80]; + + n = 0; + LIST_FOREACH(term, &tty_terms, entry) { + cmdq_print(cmdq, + "Terminal %u: %s [references=%u, flags=0x%x]:", + n, term->name, term->references, term->flags); + n++; + for (i = 0; i < NTTYCODE; i++) { + ent = &tty_term_codes[i]; + code = &term->codes[ent->code]; + switch (code->type) { + case TTYCODE_NONE: + cmdq_print(cmdq, "%4u: %s: [missing]", + ent->code, ent->name); + break; + case TTYCODE_STRING: + strnvis(out, code->value.string, sizeof out, + VIS_OCTAL|VIS_TAB|VIS_NL); + cmdq_print(cmdq, "%4u: %s: (string) %s", + ent->code, ent->name, out); + break; + case TTYCODE_NUMBER: + cmdq_print(cmdq, "%4u: %s: (number) %d", + ent->code, ent->name, code->value.number); + break; + case TTYCODE_FLAG: + cmdq_print(cmdq, "%4u: %s: (flag) %s", + ent->code, ent->name, + code->value.flag ? "true" : "false"); + break; + } + } + } +} + +void +cmd_show_messages_jobs (struct cmd_q *cmdq) +{ + struct job *job; + u_int n; + + n = 0; + LIST_FOREACH(job, &all_jobs, lentry) { + cmdq_print(cmdq, + "Job %u: %s [fd=%d, pid=%d, status=%d]", + n, job->cmd, job->fd, job->pid, job->status); + n++; + } +} + enum cmd_retval cmd_show_messages_exec(struct cmd *self, struct cmd_q *cmdq) { @@ -46,6 +132,27 @@ cmd_show_messages_exec(struct cmd *self, struct cmd_q *cmdq) struct message_entry *msg; char *tim; u_int i; + int done; + + done = 0; + if (args_has (args, 'I') || self->entry == &cmd_server_info_entry) { + cmd_show_messages_server (cmdq); + done = 1; + } + if (args_has (args, 'T') || self->entry == &cmd_server_info_entry) { + if (done) + cmdq_print (cmdq, "%s", ""); + cmd_show_messages_terminals (cmdq); + done = 1; + } + if (args_has (args, 'J') || self->entry == &cmd_server_info_entry) { + if (done) + cmdq_print (cmdq, "%s", ""); + cmd_show_messages_jobs (cmdq); + done = 1; + } + if (done) + return (CMD_RETURN_NORMAL); if ((c = cmd_find_client(cmdq, args_get(args, 't'), 0)) == NULL) return (CMD_RETURN_ERROR); diff --git a/cmd-start-server.c b/cmd-start-server.c deleted file mode 100644 index 33b28b4a..00000000 --- a/cmd-start-server.c +++ /dev/null @@ -1,42 +0,0 @@ -/* $Id$ */ - -/* - * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER - * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING - * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include <sys/types.h> - -#include "tmux.h" - -/* - * Start the server and do nothing else. - */ - -enum cmd_retval cmd_start_server_exec(struct cmd *, struct cmd_q *); - -const struct cmd_entry cmd_start_server_entry = { - "start-server", "start", - "", 0, 0, - "", - CMD_STARTSERVER, - NULL, - cmd_start_server_exec -}; - -enum cmd_retval -cmd_start_server_exec(unused struct cmd *self, unused struct cmd_q *cmdq) -{ - return (CMD_RETURN_NORMAL); -} diff --git a/configure.ac b/configure.ac index 644b283d..f646a0d0 100644 --- a/configure.ac +++ b/configure.ac @@ -16,6 +16,7 @@ AC_CANONICAL_HOST # Set up the compiler in two different ways and say yes we may want to install. AC_PROG_CC AM_PROG_CC_C_O +AC_PROG_MKDIR_P AC_PROG_INSTALL # Default tmux.conf goes in /etc not ${prefix}/etc. @@ -37,7 +37,6 @@ /* Default grid cell data. */ const struct grid_cell grid_default_cell = { 0, 0, 8, 8, (1 << 4) | 1, " " }; -const struct grid_cell grid_marker_cell = { 0, 0, 8, 8, (1 << 4) | 1, "_" }; #define grid_put_cell(gd, px, py, gc) do { \ memcpy(&gd->linedata[py].celldata[px], \ @@ -74,6 +74,7 @@ void input_csi_dispatch_rm(struct input_ctx *); void input_csi_dispatch_rm_private(struct input_ctx *); void input_csi_dispatch_sm(struct input_ctx *); void input_csi_dispatch_sm_private(struct input_ctx *); +void input_csi_dispatch_winops(struct input_ctx *); void input_csi_dispatch_sgr(struct input_ctx *); int input_dcs_dispatch(struct input_ctx *); int input_utf8_open(struct input_ctx *); @@ -154,6 +155,7 @@ enum input_csi_type { INPUT_CSI_SM_PRIVATE, INPUT_CSI_TBC, INPUT_CSI_VPA, + INPUT_CSI_WINOPS, }; /* Control (CSI) command table. */ @@ -188,6 +190,7 @@ const struct input_table_entry input_csi_table[] = { { 'q', " ", INPUT_CSI_DECSCUSR }, { 'r', "", INPUT_CSI_DECSTBM }, { 's', "", INPUT_CSI_SCP }, + { 't', "", INPUT_CSI_WINOPS }, { 'u', "", INPUT_CSI_RCP }, }; @@ -1077,7 +1080,7 @@ input_csi_dispatch(struct input_ctx *ictx) struct screen_write_ctx *sctx = &ictx->ctx; struct screen *s = sctx->s; struct input_table_entry *entry; - int n, m; + int n, m; if (ictx->flags & INPUT_DISCARD) return (0); @@ -1117,6 +1120,9 @@ input_csi_dispatch(struct input_ctx *ictx) m = input_get(ictx, 1, 1, 1); screen_write_cursormove(sctx, m - 1, n - 1); break; + case INPUT_CSI_WINOPS: + input_csi_dispatch_winops(ictx); + break; case INPUT_CSI_CUU: screen_write_cursorup(sctx, input_get(ictx, 0, 1, 1)); break; @@ -1430,6 +1436,55 @@ input_csi_dispatch_sm_private(struct input_ctx *ictx) } } +/* Handle CSI window operations. */ +void +input_csi_dispatch_winops(struct input_ctx *ictx) +{ + struct window_pane *wp = ictx->wp; + int n, m; + + m = 0; + while ((n = input_get(ictx, m, 0, -1)) != -1) { + switch (n) { + case 1: + case 2: + case 5: + case 6: + case 7: + case 11: + case 13: + case 14: + case 19: + case 20: + case 21: + case 24: + break; + case 3: + case 4: + case 8: + m++; + if (input_get(ictx, m, 0, -1) == -1) + return; + /* FALLTHROUGH */ + case 9: + case 10: + case 22: + case 23: + m++; + if (input_get(ictx, m, 0, -1) == -1) + return; + break; + case 18: + input_reply(ictx, "\033[8;%u;%u", wp->sy, wp->sx); + break; + default: + log_debug("%s: unknown '%c'", __func__, ictx->ch); + break; + } + m++; + } +} + /* Handle CSI SGR. */ void input_csi_dispatch_sgr(struct input_ctx *ictx) diff --git a/options-table.c b/options-table.c index 5da095b1..64d3edcd 100644 --- a/options-table.c +++ b/options-table.c @@ -195,32 +195,43 @@ const struct options_table_entry session_options_table[] = { { .name = "message-attr", .type = OPTIONS_TABLE_ATTRIBUTES, - .default_num = 0 + .default_num = 0, + .style = "message-style" }, { .name = "message-bg", .type = OPTIONS_TABLE_COLOUR, - .default_num = 3 + .default_num = 3, + .style = "message-style" }, { .name = "message-command-attr", .type = OPTIONS_TABLE_ATTRIBUTES, - .default_num = 0 + .default_num = 0, + .style = "message-command-style" }, { .name = "message-command-bg", .type = OPTIONS_TABLE_COLOUR, - .default_num = 0 + .default_num = 0, + .style = "message-command-style" }, { .name = "message-command-fg", .type = OPTIONS_TABLE_COLOUR, - .default_num = 3 + .default_num = 3, + .style = "message-command-style" + }, + + { .name = "message-command-style", + .type = OPTIONS_TABLE_STYLE, + .default_str = "bg=black,fg=yellow" }, { .name = "message-fg", .type = OPTIONS_TABLE_COLOUR, - .default_num = 0 + .default_num = 0, + .style = "message-style" }, { .name = "message-limit", @@ -230,6 +241,11 @@ const struct options_table_entry session_options_table[] = { .default_num = 20 }, + { .name = "message-style", + .type = OPTIONS_TABLE_STYLE, + .default_str = "bg=yellow,fg=black" + }, + { .name = "mouse-resize-pane", .type = OPTIONS_TABLE_FLAG, .default_num = 0 @@ -252,22 +268,36 @@ const struct options_table_entry session_options_table[] = { { .name = "pane-active-border-bg", .type = OPTIONS_TABLE_COLOUR, - .default_num = 8 + .default_num = 8, + .style = "pane-active-border-style" }, { .name = "pane-active-border-fg", .type = OPTIONS_TABLE_COLOUR, - .default_num = 2 + .default_num = 2, + .style = "pane-active-border-style" + }, + + { .name = "pane-active-border-style", + .type = OPTIONS_TABLE_STYLE, + .default_str = "fg=green" }, { .name = "pane-border-bg", .type = OPTIONS_TABLE_COLOUR, - .default_num = 8 + .default_num = 8, + .style = "pane-border-style" }, { .name = "pane-border-fg", .type = OPTIONS_TABLE_COLOUR, - .default_num = 8 + .default_num = 8, + .style = "pane-border-style" + }, + + { .name = "pane-border-style", + .type = OPTIONS_TABLE_STYLE, + .default_str = "default" }, { .name = "prefix", @@ -314,17 +344,20 @@ const struct options_table_entry session_options_table[] = { { .name = "status-attr", .type = OPTIONS_TABLE_ATTRIBUTES, - .default_num = 0 + .default_num = 0, + .style = "status-style" }, |