parent
d9583187e5
commit
df6c23769f
13
app.go
13
app.go
@ -84,9 +84,9 @@ func (app *App) exportVars() {
|
|||||||
|
|
||||||
// This function is used to run a command in shell. Following modes are used:
|
// This function is used to run a command in shell. Following modes are used:
|
||||||
//
|
//
|
||||||
// Prefix Wait Async Stdin/Stdout/Stderr UI action (before/after)
|
// Prefix Wait Async Stdin/Stdout/Stderr UI action
|
||||||
// $ No No Yes Do nothing and then sync
|
// $ No No Yes Pause and then resume
|
||||||
// ! Yes No Yes pause and then resume
|
// ! Yes No Yes Pause and then resume
|
||||||
// & No Yes No Do nothing
|
// & No Yes No Do nothing
|
||||||
//
|
//
|
||||||
// Waiting async commands are not used for now.
|
// 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.Stdin = os.Stdin
|
||||||
cmd.Stdout = os.Stdout
|
cmd.Stdout = os.Stdout
|
||||||
cmd.Stderr = os.Stderr
|
cmd.Stderr = os.Stderr
|
||||||
}
|
|
||||||
|
|
||||||
if wait {
|
|
||||||
app.ui.pause()
|
app.ui.pause()
|
||||||
defer app.ui.resume()
|
defer app.ui.resume()
|
||||||
} else {
|
defer app.nav.renew(app.ui.wins[0].h)
|
||||||
defer app.ui.sync()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
defer app.nav.renew(app.ui.wins[0].h)
|
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
if async {
|
if async {
|
||||||
err = cmd.Start()
|
err = cmd.Start()
|
||||||
|
8
ui.go
8
ui.go
@ -490,14 +490,6 @@ func (ui *UI) sync() {
|
|||||||
if err := termbox.Sync(); err != nil {
|
if err := termbox.Sync(); err != nil {
|
||||||
log.Printf("syncing termbox: %s", err)
|
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) {
|
func (ui *UI) showMenu(b *bytes.Buffer) {
|
||||||
|
Loading…
Reference in New Issue
Block a user