The branch, master has been updated via 01a47525030ec6fa4f53dc2c0cb6786f63881679 (commit) via d66cbf20f7ddeca5e350a79ffaf3a18e1da231fb (commit) via 7e4314eccbc9dd36340e6ca3d0eccfc7e678b219 (commit) from 5eeee39cc18a1205f69dd42c626312b9456ead4b (commit)
- Log ----------------------------------------------------------------- commit 01a47525030ec6fa4f53dc2c0cb6786f63881679 Author: Nicholas Marriott <nicholas.marri...@gmail.com> Commit: Nicholas Marriott <nicholas.marri...@gmail.com> Merge IDENTIFY_* flags with CLIENT_* flags. --- client.c | 16 +++++++--------- server-client.c | 10 +++++----- tmux.c | 16 ++++++++-------- tmux.h | 11 +++++------ 4 files changed, 25 insertions(+), 28 deletions(-) diff --git a/client.c b/client.c index bb1b34c..13c9ca9 100644 --- a/client.c +++ b/client.c @@ -236,7 +236,7 @@ client_main(int argc, char **argv, int flags) setblocking(STDIN_FILENO, 0); event_set(&client_stdin, STDIN_FILENO, EV_READ|EV_PERSIST, client_stdin_callback, NULL); - if (flags & IDENTIFY_TERMIOS) { + if (flags & CLIENT_CONTROLCONTROL) { if (tcgetattr(STDIN_FILENO, &saved_tio) != 0) { fprintf(stderr, "tcgetattr failed: %s\n", strerror(errno)); @@ -293,14 +293,12 @@ client_main(int argc, char **argv, int flags) ppid = getppid(); if (client_exittype == MSG_DETACHKILL && ppid > 1) kill(ppid, SIGHUP); - } else if (flags & IDENTIFY_TERMIOS) { - if (flags & IDENTIFY_CONTROL) { - if (client_exitreason != CLIENT_EXIT_NONE) - printf("%%exit %s\n", client_exit_message()); - else - printf("%%exit\n"); - printf("\033\\"); - } + } else if (flags & CLIENT_CONTROLCONTROL) { + if (client_exitreason != CLIENT_EXIT_NONE) + printf("%%exit %s\n", client_exit_message()); + else + printf("%%exit\n"); + printf("\033\\"); tcsetattr(STDOUT_FILENO, TCSAFLUSH, &saved_tio); } setblocking(STDIN_FILENO, 1); diff --git a/server-client.c b/server-client.c index fa4d268..7a9f911 100644 --- a/server-client.c +++ b/server-client.c @@ -956,12 +956,12 @@ server_client_msg_identify( if (*data->cwd != '\0') c->cwd = xstrdup(data->cwd); - if (data->flags & IDENTIFY_CONTROL) { + if (data->flags & CLIENT_CONTROL) { c->stdin_callback = control_callback; evbuffer_free(c->stderr_data); c->stderr_data = c->stdout_data; c->flags |= CLIENT_CONTROL; - if (data->flags & IDENTIFY_TERMIOS) + if (data->flags & CLIENT_CONTROLCONTROL) evbuffer_add_printf(c->stdout_data, "\033P1000p"); server_write_client(c, MSG_STDIN, NULL, 0); @@ -980,14 +980,14 @@ server_client_msg_identify( } data->term[(sizeof data->term) - 1] = '\0'; tty_init(&c->tty, c, fd, data->term); - if (data->flags & IDENTIFY_UTF8) + if (data->flags & CLIENT_UTF8) c->tty.flags |= TTY_UTF8; - if (data->flags & IDENTIFY_256COLOURS) + if (data->flags & CLIENT_256COLOURS) c->tty.term_flags |= TERM_256COLOURS; tty_resize(&c->tty); - if (!(data->flags & IDENTIFY_CONTROL)) + if (!(data->flags & CLIENT_CONTROL)) c->flags |= CLIENT_TERMINAL; } diff --git a/tmux.c b/tmux.c index f68beee..76b09cf 100644 --- a/tmux.c +++ b/tmux.c @@ -264,17 +264,17 @@ main(int argc, char **argv) while ((opt = getopt(argc, argv, "2c:Cdf:lL:qS:uUVv")) != -1) { switch (opt) { case '2': - flags |= IDENTIFY_256COLOURS; + flags |= CLIENT_256COLOURS; break; case 'c': free(shell_cmd); shell_cmd = xstrdup(optarg); break; case 'C': - if (flags & IDENTIFY_CONTROL) - flags |= IDENTIFY_TERMIOS; + if (flags & CLIENT_CONTROL) + flags |= CLIENT_CONTROLCONTROL; else - flags |= IDENTIFY_CONTROL; + flags |= CLIENT_CONTROL; break; case 'V': printf("%s %s\n", __progname, VERSION); @@ -298,7 +298,7 @@ main(int argc, char **argv) path = xstrdup(optarg); break; case 'u': - flags |= IDENTIFY_UTF8; + flags |= CLIENT_UTF8; break; case 'v': debug_level++; @@ -313,7 +313,7 @@ main(int argc, char **argv) if (shell_cmd != NULL && argc != 0) usage(); - if (!(flags & IDENTIFY_UTF8)) { + if (!(flags & CLIENT_UTF8)) { /* * If the user has set whichever of LC_ALL, LC_CTYPE or LANG * exist (in that order) to contain UTF-8, it is a safe @@ -327,7 +327,7 @@ main(int argc, char **argv) } if (s != NULL && (strcasestr(s, "UTF-8") != NULL || strcasestr(s, "UTF8") != NULL)) - flags |= IDENTIFY_UTF8; + flags |= CLIENT_UTF8; } environ_init(&global_environ); @@ -346,7 +346,7 @@ main(int argc, char **argv) options_table_populate_tree(window_options_table, &global_w_options); /* Enable UTF-8 if the first client is on UTF-8 terminal. */ - if (flags & IDENTIFY_UTF8) { + if (flags & CLIENT_UTF8) { options_set_number(&global_s_options, "status-utf8", 1); options_set_number(&global_s_options, "mouse-utf8", 1); options_set_number(&global_w_options, "utf8", 1); diff --git a/tmux.h b/tmux.h index 345efab..3b4f815 100644 --- a/tmux.h +++ b/tmux.h @@ -484,11 +484,6 @@ struct msg_identify_data { char ttyname[TTY_NAME_MAX]; #endif -#define IDENTIFY_UTF8 0x1 -#define IDENTIFY_256COLOURS 0x2 -/* 0x4 unused */ -#define IDENTIFY_CONTROL 0x8 -#define IDENTIFY_TERMIOS 0x10 int flags; }; @@ -1341,7 +1336,11 @@ struct client { #define CLIENT_READONLY 0x800 #define CLIENT_REDRAWWINDOW 0x1000 #define CLIENT_CONTROL 0x2000 -#define CLIENT_FOCUSED 0x4000 +#define CLIENT_CONTROLCONTROL 0x4000 +#define CLIENT_FOCUSED 0x8000 +#define CLIENT_UTF8 0x10000 +#define CLIENT_256COLOURS 0x20000 +#define CLIENT_IDENTIFIED 0x40000 int flags; struct event identify_timer; commit d66cbf20f7ddeca5e350a79ffaf3a18e1da231fb Author: Nicholas Marriott <nicholas.marri...@gmail.com> Commit: Nicholas Marriott <nicholas.marri...@gmail.com> Bump protocol version and add new message types. --- tmux.h | 35 ++++++++++++++++++++++------------- 1 files changed, 22 insertions(+), 13 deletions(-) diff --git a/tmux.h b/tmux.h index dd35195..345efab 100644 --- a/tmux.h +++ b/tmux.h @@ -19,7 +19,7 @@ #ifndef TMUX_H #define TMUX_H -#define PROTOCOL_VERSION 7 +#define PROTOCOL_VERSION 8 #include <sys/param.h> #include <sys/time.h> @@ -430,27 +430,36 @@ ARRAY_DECL(causelist, char *); /* Message codes. */ enum msgtype { - MSG_COMMAND, + MSG_VERSION = 12, + + MSG_IDENTIFY_FLAGS = 100, + MSG_IDENTIFY_TERM, + MSG_IDENTIFY_TTYNAME, + MSG_IDENTIFY_CWD, + MSG_IDENTIFY_STDIN, + MSG_IDENTIFY_ENVIRON, + MSG_IDENTIFY_DONE, + + MSG_COMMAND = 200, MSG_DETACH, - MSG_ERROR, + MSG_DETACHKILL, MSG_EXIT, MSG_EXITED, MSG_EXITING, - MSG_IDENTIFY, - MSG_STDIN, + MSG_LOCK, MSG_READY, MSG_RESIZE, - MSG_SHUTDOWN, - MSG_SUSPEND, - MSG_VERSION, - MSG_WAKEUP, - MSG_ENVIRON, - MSG_UNLOCK, - MSG_LOCK, MSG_SHELL, + MSG_SHUTDOWN, MSG_STDERR, + MSG_STDIN, MSG_STDOUT, - MSG_DETACHKILL + MSG_SUSPEND, + MSG_UNLOCK, + MSG_WAKEUP, + + MSG_IDENTIFY = 300, + MSG_ENVIRON }; /* commit 7e4314eccbc9dd36340e6ca3d0eccfc7e678b219 Author: Nicholas Marriott <nicholas.marri...@gmail.com> Commit: Nicholas Marriott <nicholas.marri...@gmail.com> Remove CMD_SENDENVIRON. --- client.c | 7 ++----- cmd-attach-session.c | 2 +- cmd-new-session.c | 2 +- tmux.h | 3 +-- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/client.c b/client.c index b9e3b30..bb1b34c 100644 --- a/client.c +++ b/client.c @@ -179,7 +179,7 @@ client_main(int argc, char **argv, int flags) cmdflags = CMD_STARTSERVER; } else if (argc == 0) { msg = MSG_COMMAND; - cmdflags = CMD_STARTSERVER|CMD_SENDENVIRON|CMD_CANTNEST; + cmdflags = CMD_STARTSERVER|CMD_CANTNEST; } else { msg = MSG_COMMAND; @@ -197,8 +197,6 @@ client_main(int argc, char **argv, int flags) TAILQ_FOREACH(cmd, &cmdlist->list, qentry) { if (cmd->entry->flags & CMD_STARTSERVER) cmdflags |= CMD_STARTSERVER; - if (cmd->entry->flags & CMD_SENDENVIRON) - cmdflags |= CMD_SENDENVIRON; if (cmd->entry->flags & CMD_CANTNEST) cmdflags |= CMD_CANTNEST; } @@ -262,8 +260,7 @@ client_main(int argc, char **argv, int flags) set_signals(client_signal); /* Send initial environment. */ - if (cmdflags & CMD_SENDENVIRON) - client_send_environ(); + client_send_environ(); client_send_identify(flags); /* Send first command. */ diff --git a/cmd-attach-session.c b/cmd-attach-session.c index cf5f30a..7a952e5 100644 --- a/cmd-attach-session.c +++ b/cmd-attach-session.c @@ -32,7 +32,7 @@ const struct cmd_entry cmd_attach_session_entry = { "attach-session", "attach", "drt:", 0, 0, "[-dr] " CMD_TARGET_SESSION_USAGE, - CMD_CANTNEST|CMD_STARTSERVER|CMD_SENDENVIRON, + CMD_CANTNEST|CMD_STARTSERVER, NULL, cmd_attach_session_exec }; diff --git a/cmd-new-session.c b/cmd-new-session.c index 1c743a8..38c79a6 100644 --- a/cmd-new-session.c +++ b/cmd-new-session.c @@ -38,7 +38,7 @@ const struct cmd_entry cmd_new_session_entry = { "[-AdDP] [-c start-directory] [-F format] [-n window-name] " "[-s session-name] " CMD_TARGET_SESSION_USAGE " [-x width] [-y height] " "[command]", - CMD_STARTSERVER|CMD_CANTNEST|CMD_SENDENVIRON, + CMD_STARTSERVER|CMD_CANTNEST, NULL, cmd_new_session_exec }; diff --git a/tmux.h b/tmux.h index b6b66fb..dd35195 100644 --- a/tmux.h +++ b/tmux.h @@ -1447,8 +1447,7 @@ struct cmd_entry { #define CMD_STARTSERVER 0x1 #define CMD_CANTNEST 0x2 -#define CMD_SENDENVIRON 0x4 -#define CMD_READONLY 0x8 +#define CMD_READONLY 0x4 int flags; void (*key_binding)(struct cmd *, int); ----------------------------------------------------------------------- Summary of changes: client.c | 23 +++++++++-------------- cmd-attach-session.c | 2 +- cmd-new-session.c | 2 +- server-client.c | 10 +++++----- tmux.c | 16 ++++++++-------- tmux.h | 49 ++++++++++++++++++++++++++++--------------------- 6 files changed, 52 insertions(+), 50 deletions(-) hooks/post-receive -- tmux ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk _______________________________________________ tmux-cvs mailing list tmux-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-cvs