diff options
author | 2013-03-25 10:03:24 +0000 | |
---|---|---|
committer | 2013-03-25 10:03:24 +0000 | |
commit | 84f8cb9971038b37f0b889b5f13a5557d0bd7d55 (patch) | |
tree | aa2f4457d47f5d478248414acf40ff54b98f5336 | |
parent | Remove previous. (diff) | |
download | wireguard-openbsd-84f8cb9971038b37f0b889b5f13a5557d0bd7d55.tar.xz wireguard-openbsd-84f8cb9971038b37f0b889b5f13a5557d0bd7d55.zip |
Send DSC 1000p at the beginning of a -CC client's lifetime and ST and
the end, from George Nachman.
-rw-r--r-- | usr.bin/tmux/client.c | 12 | ||||
-rw-r--r-- | usr.bin/tmux/server-client.c | 4 |
2 files changed, 13 insertions, 3 deletions
diff --git a/usr.bin/tmux/client.c b/usr.bin/tmux/client.c index 3d48cc99262..1f47880a5c5 100644 --- a/usr.bin/tmux/client.c +++ b/usr.bin/tmux/client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: client.c,v 1.62 2013/03/24 09:54:10 nicm Exp $ */ +/* $OpenBSD: client.c,v 1.63 2013/03/25 10:03:24 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -292,8 +292,16 @@ 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) + } 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\\"); + } tcsetattr(STDOUT_FILENO, TCSAFLUSH, &saved_tio); + } setblocking(STDIN_FILENO, 1); return (client_exitval); } diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c index edadf6f45bd..a38d98c5d3e 100644 --- a/usr.bin/tmux/server-client.c +++ b/usr.bin/tmux/server-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-client.c,v 1.95 2013/03/24 09:57:59 nicm Exp $ */ +/* $OpenBSD: server-client.c,v 1.96 2013/03/25 10:03:24 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net> @@ -957,6 +957,8 @@ server_client_msg_identify( if (data->flags & IDENTIFY_CONTROL) { c->stdin_callback = control_callback; c->flags |= CLIENT_CONTROL; + if (data->flags & IDENTIFY_TERMIOS) + evbuffer_add_printf(c->stdout_data, "\033P1000p"); server_write_client(c, MSG_STDIN, NULL, 0); c->tty.fd = -1; |