ssh kitten: Fix a regression in 0.28.0 that caused interrupt during setup to not be handled gracefully
Fixes #6254
This commit is contained in:
parent
71189aee9f
commit
454acd4f5c
@ -59,6 +59,8 @@ Detailed list of changes
|
||||
|
||||
- edit-in-kitty: Fix running edit-in-kitty with elevated privileges to edit a restricted file not working (:disc:`6245`)
|
||||
|
||||
- ssh kitten: Fix a regression in 0.28.0 that caused interrupt during setup to not be handled gracefully (:iss:`6254`)
|
||||
|
||||
0.28.1 [2023-04-21]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
@ -16,6 +16,7 @@ import (
|
||||
"net/url"
|
||||
"os"
|
||||
"os/exec"
|
||||
"os/signal"
|
||||
"os/user"
|
||||
"path"
|
||||
"path/filepath"
|
||||
@ -669,6 +670,9 @@ func run_ssh(ssh_args, server_args, found_extra_args []string) (rc int, err erro
|
||||
if err != nil {
|
||||
return 1, err
|
||||
}
|
||||
sigs := make(chan os.Signal, 8)
|
||||
signal.Notify(sigs, unix.SIGINT, unix.SIGTERM)
|
||||
|
||||
if !cd.request_data {
|
||||
rq := fmt.Sprintf("id=%s:pwfile=%s:pw=%s", cd.replacements["REQUEST_ID"], cd.replacements["PASSWORD_FILENAME"], cd.replacements["DATA_PASSWORD"])
|
||||
err := term.ApplyOperations(tty.TCSANOW, tty.SetNoEcho)
|
||||
@ -685,6 +689,11 @@ func run_ssh(ssh_args, server_args, found_extra_args []string) (rc int, err erro
|
||||
return 1, err
|
||||
}
|
||||
}
|
||||
go func() {
|
||||
_ = <-sigs
|
||||
// ignore any interrupt and terminate signals as they will usually be sent to the ssh child process as well
|
||||
// and we are waiting on that.
|
||||
}()
|
||||
err = c.Wait()
|
||||
drain_potential_tty_garbage(term)
|
||||
if err != nil {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user