summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2013-03-25 10:03:24 +0000
committerNicholas Marriott <nicm@openbsd.org>2013-03-25 10:03:24 +0000
commit62db3c8efe70020e2555e3f34e8c07d0b2106077 (patch)
tree7a7c231842134de4800a0ae1d88142ebb52829bf /client.c
parentefa06643b02ca7cdc306d7ebcf1e38f04d2edc62 (diff)
Send DSC 1000p at the beginning of a -CC client's lifetime and ST and
the end, from George Nachman.
Diffstat (limited to 'client.c')
-rw-r--r--client.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/client.c b/client.c
index 8693afeb..1ab42c51 100644
--- a/client.c
+++ b/client.c
@@ -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);
}