summary refs log tree commit diff
path: root/bin/ptee.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-07-17 23:09:34 -0400
committerJune McEnroe <june@causal.agency>2019-07-17 23:09:34 -0400
commit5b1a2fb9460c46c58dc5008a8fc4c81251e9d983 (patch)
tree2b39e640f6dd49b740e41945067c4ac4988b8dbb /bin/ptee.c
parentAdd Adulthood Rites (diff)
downloadsrc-5b1a2fb9460c46c58dc5008a8fc4c81251e9d983.tar.gz
src-5b1a2fb9460c46c58dc5008a8fc4c81251e9d983.zip
Add ^Q to ptee for MC sequence
Diffstat (limited to 'bin/ptee.c')
-rw-r--r--bin/ptee.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/ptee.c b/bin/ptee.c
index 94be3037..6bc20fc5 100644
--- a/bin/ptee.c
+++ b/bin/ptee.c
@@ -83,6 +83,13 @@ int main(int argc, char *argv[]) {
 				continue;
 			}
 
+			if (rlen == 1 && buf[0] == CTRL('Q')) {
+				char dump[] = "\x1B[10i";
+				ssize_t wlen = write(STDOUT_FILENO, dump, sizeof(dump) - 1);
+				if (wlen < 0) err(EX_IOERR, "write");
+				continue;
+			}
+
 			ssize_t wlen = write(pty, buf, rlen);
 			if (wlen < 0) err(EX_IOERR, "write");
 		}