Branch: Tag:

2020-02-13

2020-02-13 11:53:56 by Henrik Grubbström (Grubba) <grubba@grubba.org>

I/O [NT]: Keep track of processes using ConPTY slaves.

Due to the way that ptys are implemented on NT, the master side
read pipe will not receive an EOF when all clients have terminated
(since the ConPTY process is still running).

We now keep track of the processes and kill the ConPTY when all
the processes using the slave side are gone. Note that this is
NOT 100% (or even 80%) safe. Indirect processes may still be
running, or processes may terminate after we have already entered
a blocking read().

A feature request has been registered with the Windows Terminal
team (https://github.com/microsoft/terminal/issues/4564).

14:   void my_signal(int sig, sigfunctype fun);   PMOD_EXPORT void check_signals(struct callback *foo, void *bar, void *gazonk);   void set_default_signal_handler(int signum, void (*func)(INT32)); + #ifdef __NT__ + struct pid_status *pid_status_unlink_pty(struct pid_status *pid); + int check_pty_clients(struct my_pty *pty); + #endif   void process_started(pid_t pid);   void process_done(pid_t pid, const char *from);   struct wait_data;