diff --git a/repos/ports/src/noux/terminal_io_channel.h b/repos/ports/src/noux/terminal_io_channel.h index 7b3f633c96..e4f3ef165e 100644 --- a/repos/ports/src/noux/terminal_io_channel.h +++ b/repos/ports/src/noux/terminal_io_channel.h @@ -35,6 +35,8 @@ struct Noux::Terminal_io_channel : Io_channel Signal_handler _resize_handler; + enum { EOF = 4 }; + bool eof = false; enum Type { STDIN, STDOUT, STDERR } type; @@ -102,8 +104,6 @@ struct Noux::Terminal_io_channel : Io_channel char c = read_buffer.get(); - enum { EOF = 4 }; - if (c == EOF) { /* @@ -225,6 +225,11 @@ struct Noux::Terminal_io_channel : Io_channel void _handle_resize() { + /* respond to terminal-close event */ + Terminal::Session::Size const size = _terminal.size(); + if (_terminal.size().columns()*_terminal.size().lines() == 0) + read_buffer.add(EOF); + Io_channel::invoke_all_interrupt_handlers(Sysio::SIG_WINCH); } };