Do not disable mouse after execute(-silent) when --height option is used

The action takes place in the alternate screen so the offsets should
still be correct.
This commit is contained in:
Junegunn Choi 2020-05-18 02:33:37 +09:00
parent ace92ba281
commit 97a725fbd0
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627
5 changed files with 16 additions and 16 deletions

View File

@ -1422,13 +1422,13 @@ func (t *Terminal) executeCommand(template string, forcePlus bool, background bo
cmd.Stderr = os.Stderr
t.tui.Pause(true)
cmd.Run()
t.tui.Resume(true)
t.tui.Resume(true, false)
t.redraw()
t.refresh()
} else {
t.tui.Pause(false)
cmd.Run()
t.tui.Resume(false)
t.tui.Resume(false, false)
}
cleanTemporaryFiles()
}
@ -1701,7 +1701,7 @@ func (t *Terminal) Loop() {
case reqRefresh:
t.suppress = false
case reqReinit:
t.tui.Resume(t.fullscreen)
t.tui.Resume(t.fullscreen, true)
t.redraw()
case reqRedraw:
t.redraw()

View File

@ -25,12 +25,12 @@ const (
Reverse = Attr(1 << 6)
)
func (r *FullscreenRenderer) Init() {}
func (r *FullscreenRenderer) Pause(bool) {}
func (r *FullscreenRenderer) Resume(bool) {}
func (r *FullscreenRenderer) Clear() {}
func (r *FullscreenRenderer) Refresh() {}
func (r *FullscreenRenderer) Close() {}
func (r *FullscreenRenderer) Init() {}
func (r *FullscreenRenderer) Pause(bool) {}
func (r *FullscreenRenderer) Resume(bool, bool) {}
func (r *FullscreenRenderer) Clear() {}
func (r *FullscreenRenderer) Refresh() {}
func (r *FullscreenRenderer) Close() {}
func (r *FullscreenRenderer) DoesAutoWrap() bool { return false }
func (r *FullscreenRenderer) GetChar() Event { return Event{} }

View File

@ -561,7 +561,7 @@ func (r *LightRenderer) Pause(clear bool) {
}
}
func (r *LightRenderer) Resume(clear bool) {
func (r *LightRenderer) Resume(clear bool, sigcont bool) {
r.setupTerminal()
if clear {
if r.fullscreen {
@ -570,10 +570,10 @@ func (r *LightRenderer) Resume(clear bool) {
r.rmcup()
}
r.flush()
} else if !r.fullscreen && r.mouse {
// NOTE: Resume(false) is only called on SIGCONT after SIGSTOP.
// And It's highly likely that the offset we obtained at the beginning will
// no longer be correct, so we simply disable mouse input.
} else if sigcont && !r.fullscreen && r.mouse {
// NOTE: SIGCONT (Coming back from CTRL-Z):
// It's highly likely that the offset we obtained at the beginning is
// no longer correct, so we simply disable mouse input.
r.csi("?1000l")
r.mouse = false
}

View File

@ -394,7 +394,7 @@ func (r *FullscreenRenderer) Pause(clear bool) {
}
}
func (r *FullscreenRenderer) Resume(clear bool) {
func (r *FullscreenRenderer) Resume(clear bool, sigcont bool) {
if clear {
r.initScreen()
}

View File

@ -275,7 +275,7 @@ func MakeTransparentBorder() BorderStyle {
type Renderer interface {
Init()
Pause(clear bool)
Resume(clear bool)
Resume(clear bool, sigcont bool)
Clear()
RefreshWindows(windows []Window)
Refresh()