switch back to ca mode after suspend/resume

Suspend call currently exits ca mode. So after the first suspend/resume
the program does not use the alternate screen anymore. Therefore Resume
needs to enter ca mode again.
This commit is contained in:
Gokcehan 2021-03-05 13:52:41 +03:00 committed by Garrett D'Amore
parent e37d20eeec
commit d003d0a0a1
2 changed files with 6 additions and 5 deletions

View File

@ -168,11 +168,6 @@ func (t *tScreen) Init() error {
t.colors[Color(i)|ColorValid] = Color(i) | ColorValid
}
t.TPuts(ti.EnterCA)
t.TPuts(ti.HideCursor)
t.TPuts(ti.EnableAcs)
t.TPuts(ti.Clear)
t.quit = make(chan struct{})
t.Lock()

View File

@ -47,6 +47,12 @@ func (t *tScreen) engage() error {
t.enablePasting(t.pasteEnabled)
signal.Notify(t.sigwinch, syscall.SIGWINCH)
ti := t.ti
t.TPuts(ti.EnterCA)
t.TPuts(ti.HideCursor)
t.TPuts(ti.EnableAcs)
t.TPuts(ti.Clear)
t.wg.Add(2)
go t.inputLoop(stopQ)
go t.mainLoop(stopQ)