From 6b2129696fbefe44d0adce1f2a11b4ae477cd07e Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 4 Jun 2015 23:27:51 +0000 Subject: Move the nested check from client to server and compare the client tty name to all the pane pty names instead of comparing socket paths. This means that "new -d" will work without unsetting $TMUX. --- tmux.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tmux.h') diff --git a/tmux.h b/tmux.h index ae1682af..8406955b 100644 --- a/tmux.h +++ b/tmux.h @@ -1374,8 +1374,7 @@ struct cmd_entry { const char *usage; #define CMD_STARTSERVER 0x1 -#define CMD_CANTNEST 0x2 -#define CMD_READONLY 0x4 +#define CMD_READONLY 0x2 int flags; enum cmd_retval (*exec)(struct cmd *, struct cmd_q *); @@ -1868,6 +1867,7 @@ void server_update_socket(void); void server_add_accept(int); /* server-client.c */ +int server_client_check_nested(struct client *); void server_client_handle_key(struct client *, int); void server_client_create(int); int server_client_open(struct client *, char **); -- cgit From 8c93b768e4864be330c3d6a7962892135224f0f4 Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 5 Jun 2015 18:01:12 +0000 Subject: Instead of putting dead clients on a list and checking it every loop, use event_once to queue a callback to deal with them. Also dead clients with references would never actually be freed because the wrap-up functions (the callback for stdin, or status_prompt_clear) would never be called. So call them in server_client_lost. --- tmux.h | 1 + 1 file changed, 1 insertion(+) (limited to 'tmux.h') diff --git a/tmux.h b/tmux.h index 8406955b..fa36fe6f 100644 --- a/tmux.h +++ b/tmux.h @@ -1871,6 +1871,7 @@ int server_client_check_nested(struct client *); void server_client_handle_key(struct client *, int); void server_client_create(int); int server_client_open(struct client *, char **); +void server_client_deref(struct client *); void server_client_lost(struct client *); void server_client_callback(int, short, void *); void server_client_status_timer(void); -- cgit From 10e90ae01f53a67a1b7c3a2c498cefb73c6a23b4 Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 5 Jun 2015 18:06:30 +0000 Subject: Change deref to the more sensible unref, and add a couple I missed before. --- tmux.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tmux.h') diff --git a/tmux.h b/tmux.h index fa36fe6f..7068eb44 100644 --- a/tmux.h +++ b/tmux.h @@ -1871,7 +1871,7 @@ int server_client_check_nested(struct client *); void server_client_handle_key(struct client *, int); void server_client_create(int); int server_client_open(struct client *, char **); -void server_client_deref(struct client *); +void server_client_unref(struct client *); void server_client_lost(struct client *); void server_client_callback(int, short, void *); void server_client_status_timer(void); -- cgit From 641a9cd3f591b0ace3ae9947ebe6ab889b641eed Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 5 Jun 2015 18:18:32 +0000 Subject: Similarly, for sessions use a callback to free rather than checking every loop. --- tmux.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tmux.h') diff --git a/tmux.h b/tmux.h index 7068eb44..699ee81e 100644 --- a/tmux.h +++ b/tmux.h @@ -2259,7 +2259,6 @@ void control_notify_session_close(struct session *); /* session.c */ extern struct sessions sessions; -extern struct sessions dead_sessions; extern struct session_groups session_groups; int session_cmp(struct session *, struct session *); RB_PROTOTYPE(sessions, session, entry, session_cmp); @@ -2271,6 +2270,7 @@ struct session *session_create(const char *, int, char **, const char *, int, struct environ *, struct termios *, int, u_int, u_int, char **); void session_destroy(struct session *); +void session_unref(struct session *); int session_check_name(const char *); void session_update_activity(struct session *); struct session *session_next_session(struct session *); -- cgit From 55b96a5bd5786f162b258c58627deb8e829cabd7 Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 5 Jun 2015 22:33:39 +0000 Subject: Handle the RGB colour escape sequence (\033[38;2;;;m and 48;2) like xterm(1) does, by mapping to the nearest in the 256 colour palette. --- tmux.h | 1 + 1 file changed, 1 insertion(+) (limited to 'tmux.h') diff --git a/tmux.h b/tmux.h index 699ee81e..4ddf5c4a 100644 --- a/tmux.h +++ b/tmux.h @@ -1953,6 +1953,7 @@ char *xterm_keys_lookup(int); int xterm_keys_find(const char *, size_t, size_t *, int *); /* colour.c */ +int colour_find_rgb(u_char, u_char, u_char); void colour_set_fg(struct grid_cell *, int); void colour_set_bg(struct grid_cell *, int); const char *colour_tostring(int); -- cgit From c4e811e51936edab66803a7b9e099ac135e6e19b Mon Sep 17 00:00:00 2001 From: nicm Date: Sun, 7 Jun 2015 21:39:39 +0000 Subject: Add -E flag when attaching or switching client to bypass update-environment, from Steven Lu. --- tmux.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tmux.h') diff --git a/tmux.h b/tmux.h index 4ddf5c4a..265fdc40 100644 --- a/tmux.h +++ b/tmux.h @@ -1801,7 +1801,7 @@ extern const struct cmd_entry cmd_wait_for_entry; /* cmd-attach-session.c */ enum cmd_retval cmd_attach_session(struct cmd_q *, const char *, int, int, - const char *); + const char *, int); /* cmd-list.c */ struct cmd_list *cmd_list_parse(int, char **, const char *, u_int, char **); -- cgit