diff options
author | Jesse Luehrs <doy@tozt.net> | 2014-04-09 21:20:51 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2014-04-09 21:20:51 -0400 |
commit | e9a9a54540ec467a5435c0b16fe2d9692e22cf7a (patch) | |
tree | 6c139ffa0614e61aac6c27ee39664b2e63da5c76 /pty-unix.c | |
parent | c1b938e0388146dac6f82a65f6b972519cc6532b (diff) | |
download | runes-e9a9a54540ec467a5435c0b16fe2d9692e22cf7a.tar.gz runes-e9a9a54540ec467a5435c0b16fe2d9692e22cf7a.zip |
the subprocess dying should also close the window
Diffstat (limited to 'pty-unix.c')
-rw-r--r-- | pty-unix.c | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -62,9 +62,13 @@ static void runes_got_pty_data(uv_work_t *req, int status) t = data->data.t; if (data->len > 0) { - runes_display_glyph(data->data.t, data->buf, data->len); + runes_handle_pty_read(t, data->buf, data->len); uv_queue_work(t->loop, req, runes_read_pty, runes_got_pty_data); } + else { + runes_handle_pty_close(t); + free(req); + } } void runes_pty_backend_loop_init(RunesTerm *t) @@ -83,11 +87,18 @@ void runes_pty_backend_write(RunesTerm *t, char *buf, size_t len) write(t->pty.master, buf, len); } +void runes_pty_backend_request_close(RunesTerm *t) +{ + RunesPtyBackend *pty; + + pty = &t->pty; + kill(pty->child_pid, SIGHUP); +} + void runes_pty_backend_cleanup(RunesTerm *t) { RunesPtyBackend *pty; pty = &t->pty; close(pty->master); - kill(pty->child_pid, SIGHUP); } |