Permalink
Browse files

...actually restore terminal state on exit. :whyistherenofacepalmemoji:

  • Loading branch information...
burke committed Sep 6, 2012
1 parent bc62792 commit 9f4a64872fd3f40e09cec3ab4768c0735f957c09
Showing with 5 additions and 3 deletions.
  1. +5 −3 go/zeusclient/zeusclient.go
@@ -22,6 +22,10 @@ const (
)
func Run(color bool) {
+ os.Exit(doRun(color))
+}
+
+func doRun(color bool) int {
if !color {
slog.DisableColor()
DisableErrorColor()
@@ -32,7 +36,6 @@ func Run(color bool) {
panic(err)
}
defer master.Close()
-
if ttyutils.IsTerminal(os.Stdout.Fd()) {
oldState, err := ttyutils.MakeTerminalRaw(os.Stdout.Fd())
if err != nil {
@@ -148,7 +151,6 @@ func Run(color bool) {
}
}
- os.Exit(exitStatus)
-
+ return exitStatus
}

0 comments on commit 9f4a648

Please sign in to comment.