diff options
author | Nicolas Viennot <nicolas@viennot.biz> | 2016-01-02 11:03:04 -0500 |
---|---|---|
committer | Nicolas Viennot <nicolas@viennot.biz> | 2016-01-02 11:03:04 -0500 |
commit | 0a3bd83b19c218379232a910dcff6a51ceb732d2 (patch) | |
tree | 05eaa755fec9113b67c3a573a92cc78a18d1bc54 | |
parent | 924eb0129931ab55c3c1070bff8a5e4f91c38346 (diff) |
Use a session termination message
-rw-r--r-- | session.c | 4 | ||||
-rw-r--r-- | tmate-encoder.c | 6 | ||||
-rw-r--r-- | tmate-protocol.h | 2 | ||||
-rw-r--r-- | tmate.h | 1 |
4 files changed, 13 insertions, 0 deletions
@@ -215,6 +215,10 @@ session_destroy(struct session *s) log_debug("session %s destroyed", s->name); +#ifdef TMATE + tmate_write_fin(); +#endif + RB_REMOVE(sessions, &sessions, s); notify_session_closed(s); diff --git a/tmate-encoder.c b/tmate-encoder.c index 8d47f2ef..ff6924da 100644 --- a/tmate-encoder.c +++ b/tmate-encoder.c @@ -224,3 +224,9 @@ void tmate_write_copy_mode(struct window_pane *wp, const char *str) pack(int, wp->id); pack(string, str); } + +void tmate_write_fin(void) +{ + pack(array, 1); + pack(int, TMATE_OUT_FIN); +} diff --git a/tmate-protocol.h b/tmate-protocol.h index 8611d9a7..45beaec6 100644 --- a/tmate-protocol.h +++ b/tmate-protocol.h @@ -48,6 +48,7 @@ enum tmate_daemon_out_msg_types { TMATE_OUT_STATUS, TMATE_OUT_SYNC_COPY_MODE, TMATE_OUT_WRITE_COPY_MODE, + TMATE_OUT_FIN, }; /* @@ -64,6 +65,7 @@ enum tmate_daemon_out_msg_types { [int: type, string: input_prompt, string: input_str]]) // Any of the array can be [] [TMATE_OUT_WRITE_COPY_MODE, int: pane_id, string: str] +[TMATE_OUT_FIN] */ enum tmate_daemon_in_msg_types { @@ -84,6 +84,7 @@ extern void tmate_failed_cmd(int client_id, const char *cause); extern void tmate_status(const char *left, const char *right); extern void tmate_sync_copy_mode(struct window_pane *wp); extern void tmate_write_copy_mode(struct window_pane *wp, const char *str); +extern void tmate_write_fin(void); /* tmate-decoder.c */ |