1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-20 19:27:22 +03:00
wezterm/wezterm-ssh
Wez Furlong 7926c31209 pty: introduce ChildKiller trait
In the mux layer, we have some code that takes a `Child` and then
does a bit of naughty reaching through the abstraction to get at
the pid/handle of the child so that we can send it signals even
if the child is itself mutably (and thus exclusively) borrowed
for the purposes of waiting.

That worked fine for local processes spawned in the mux, but we also
use LocalPane to wrap around arbitrary `Child`ren, such as Ssh,
that are not local and that don't have a local process id, which
meant that this hack wouldn't work for them.

To make things a bit worse, those ssh ptys were used to ssh2 days
where we didn't have a way to signal the remote process and just
did nothing, leading to confusing situations such as
https://github.com/wez/wezterm/issues/1197

This commit graduates the hack mentioned in the first paragraph
to its own ChildKiller trait.  This makes the concept of waiting
for the Child distinct from signalling it and explicitly allows
getting a separate object that can be used for signalling.

With that in place, we're forced to implement something appropriate
for the ssh pty implementations; one in the pty crate itself,
one in wezterm-ssh and the wrapper that we use in the mux crate.

The upshot of this is that the `CloseCurrentPane` action now operates
correctly on panes that were the result of split operations.
2021-12-11 08:40:26 -07:00
..
examples introduce unicode_version config 2021-11-25 09:00:45 -07:00
src pty: introduce ChildKiller trait 2021-12-11 08:40:26 -07:00
tests wezterm-ssh: ask kernel to allocate port number for tests 2021-11-23 06:16:31 -07:00
Cargo.toml pty: introduce ChildKiller trait 2021-12-11 08:40:26 -07:00