Skip to content

Commit

Permalink
Restore terminal state on exit (#13382)
Browse files Browse the repository at this point in the history
  • Loading branch information
codingllama committed Jun 24, 2022
1 parent 984d2f4 commit ccf6c49
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tool/tsh/tsh.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ import (
"github.com/gravitational/teleport/lib/sshutils/x11"
"github.com/gravitational/teleport/lib/tlsca"
"github.com/gravitational/teleport/lib/utils"
"github.com/gravitational/teleport/lib/utils/prompt"

"github.com/gravitational/kingpin"
"github.com/gravitational/trace"
Expand Down Expand Up @@ -363,7 +364,10 @@ func main() {
default:
cmdLine = cmdLineOrig
}
if err := Run(cmdLine); err != nil {

err := Run(cmdLine)
prompt.NotifyExit() // Allow prompt to restore terminal state on exit.
if err != nil {
var exitError *exitCodeError
if errors.As(err, &exitError) {
os.Exit(exitError.code)
Expand Down

0 comments on commit ccf6c49

Please sign in to comment.