mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-22 15:02:25 +00:00
noux: respond to terminal-close event
This commit is contained in:
parent
78c09c27ca
commit
44a6e51114
@ -35,6 +35,8 @@ struct Noux::Terminal_io_channel : Io_channel
|
||||
|
||||
Signal_handler<Terminal_io_channel> _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);
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user