Interrupting the text UI terminates the child process for ssh
too early
#812
Labels
defect
unison fails to meet its specification (but doesn't crash; see also "crash")
effort-medium
issue is likely resolvable with <= 20h of effort
impact-low
low importance
When interrupting the text UI with Ctrl-C (or any ^C/break in terminal input) then the generated SIGINT will terminate
ssh
beforeunison
manages to do cleanup.The issue is that
unison
will executessh
as a child process. Ifunison
is executed from a terminal then thessh
child process will be in the same process group and using the same terminal (the same session). A SIGINT generated by the terminal is sent to all processes in the same process group. The end result is that thessh
process dies beforeunison
manages to do the cleanup with the server. You can witness this by pressing Ctrl-C (withunison
in the foreground) and then receiving an error "Failed due to lost connection".I'm not sure what the solution to this is.
Creating a new process group for the child process beforeCreating a new pty like is done for ssh by the GUI is another option and probably a better one. This could also work in Windows.exec
'ing ssh is an option. Even if this works, I wonder how portable it is (it's POSIX, but still) and whether this will cause endless unforeseen side-effects.Edit: Just remembered that executing
ssh
in a different process group wouldn't work becausessh
may need input from the terminal.Originally posted by @tleedjarv in #810 (comment)
The text was updated successfully, but these errors were encountered: