diff --git a/app.go b/app.go index 232d2e7..d627171 100644 --- a/app.go +++ b/app.go @@ -84,9 +84,9 @@ func (app *App) exportVars() { // This function is used to run a command in shell. Following modes are used: // -// Prefix Wait Async Stdin/Stdout/Stderr UI action (before/after) -// $ No No Yes Do nothing and then sync -// ! Yes No Yes pause and then resume +// Prefix Wait Async Stdin/Stdout/Stderr UI action +// $ No No Yes Pause and then resume +// ! Yes No Yes Pause and then resume // & No Yes No Do nothing // // Waiting async commands are not used for now. @@ -104,17 +104,12 @@ func (app *App) runShell(s string, args []string, wait bool, async bool) { cmd.Stdin = os.Stdin cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr - } - if wait { app.ui.pause() defer app.ui.resume() - } else { - defer app.ui.sync() + defer app.nav.renew(app.ui.wins[0].h) } - defer app.nav.renew(app.ui.wins[0].h) - var err error if async { err = cmd.Start() diff --git a/ui.go b/ui.go index 4ef6f30..10838b2 100644 --- a/ui.go +++ b/ui.go @@ -490,14 +490,6 @@ func (ui *UI) sync() { if err := termbox.Sync(); err != nil { log.Printf("syncing termbox: %s", err) } - termbox.SetCursor(0, 0) - termbox.HideCursor() - - // TODO: is there an easier way to clear residual escape codes? - termbox.Close() - if err := termbox.Init(); err != nil { - log.Fatalf("initializing termbox: %s", err) - } } func (ui *UI) showMenu(b *bytes.Buffer) {