mirror of https://gogs.blitter.com/RLabs/xs
tty state restored prior to printing nonzero exit status for interactive shell sessions
Signed-off-by: Russ Magee <rmagee@gmail.com>
This commit is contained in:
parent
b4672deded
commit
5ad08fd3b3
|
@ -697,7 +697,6 @@ func main() {
|
||||||
fmt.Fprintln(os.Stderr, rejectUserMsg()) // nolint: errcheck
|
fmt.Fprintln(os.Stderr, rejectUserMsg()) // nolint: errcheck
|
||||||
rec.SetStatus(255)
|
rec.SetStatus(255)
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Set up chaffing to server
|
// Set up chaffing to server
|
||||||
conn.SetupChaff(chaffFreqMin, chaffFreqMax, chaffBytesMax) // enable client->server chaffing
|
conn.SetupChaff(chaffFreqMin, chaffFreqMax, chaffBytesMax) // enable client->server chaffing
|
||||||
if chaffEnabled {
|
if chaffEnabled {
|
||||||
|
@ -729,6 +728,7 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if rec.Status() != 0 {
|
if rec.Status() != 0 {
|
||||||
|
_ = hkexsh.Restore(int(os.Stdin.Fd()), oldState) // nolint: errcheck,gosec
|
||||||
fmt.Fprintln(os.Stderr, "Session exited with status:", rec.Status()) // nolint: errcheck
|
fmt.Fprintln(os.Stderr, "Session exited with status:", rec.Status()) // nolint: errcheck
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue