Skip to content

Commit

Permalink
Fix waiting for console attached processes to exit
Browse files Browse the repository at this point in the history
  • Loading branch information
o-sdn-o committed Oct 24, 2024
1 parent 5f67a30 commit 4e3c5c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/netxs/desktopio/system.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4321,9 +4321,9 @@ namespace netxs::os
termsize = cfg.win;
auto trailer = [&, cmd = cfg.cmd]
{
auto exitcode = termlink->wait(); // Wait all attached processes to exit (waiting for conversations to complete, send pending writebuf).
if (attached.exchange(faux))
{
auto exitcode = termlink->wait();
log("%%Process '%cmd%' exited with code %code%", prompt::vtty, ansi::hi(utf::debase437(cmd)), utf::to_hex_0x(exitcode));
writesyn.notify_one(); // Interrupt writing thread.
terminal.onexit(exitcode, "", signaled.exchange(true)); // Only if the process terminates on its own (not forced by sighup).
Expand Down

0 comments on commit 4e3c5c9

Please sign in to comment.