mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-22 23:12:24 +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;
|
Signal_handler<Terminal_io_channel> _resize_handler;
|
||||||
|
|
||||||
|
enum { EOF = 4 };
|
||||||
|
|
||||||
bool eof = false;
|
bool eof = false;
|
||||||
|
|
||||||
enum Type { STDIN, STDOUT, STDERR } type;
|
enum Type { STDIN, STDOUT, STDERR } type;
|
||||||
@ -102,8 +104,6 @@ struct Noux::Terminal_io_channel : Io_channel
|
|||||||
|
|
||||||
char c = read_buffer.get();
|
char c = read_buffer.get();
|
||||||
|
|
||||||
enum { EOF = 4 };
|
|
||||||
|
|
||||||
if (c == EOF) {
|
if (c == EOF) {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -225,6 +225,11 @@ struct Noux::Terminal_io_channel : Io_channel
|
|||||||
|
|
||||||
void _handle_resize()
|
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);
|
Io_channel::invoke_all_interrupt_handlers(Sysio::SIG_WINCH);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user