ssh_terminal: flush buffer on Terminal cleanup

Issue #4095.
This commit is contained in:
Josef Söntgen 2021-04-30 11:51:05 +02:00 committed by Norman Feske
parent f236e99b5c
commit 118e8ee6e1

View File

@ -378,6 +378,12 @@ void Ssh::Server::detach_terminal(Ssh::Terminal &conn)
auto invalidate_terminal = [&] (Session &sess) {
if (sess.terminal != &conn) { return; }
sess.terminal_detached = true;
/* flush before destroying the terminal */
Libc::with_libc([&] {
try { sess.terminal->send(sess.channel); }
catch (...) { }
});
};
_sessions.for_each(invalidate_terminal);