Try not to clear screen on Windows if TCELL_ALTSCREEN=disable

This commit is contained in:
Garrett D'Amore 2024-03-02 14:22:12 -08:00
parent 6984e257e4
commit 6c95e8dbb3
1 changed files with 5 additions and 4 deletions

View File

@ -336,19 +336,20 @@ func (s *cScreen) disengage() {
if s.vten { if s.vten {
s.emitVtString(vtCursorStyles[CursorStyleDefault]) s.emitVtString(vtCursorStyles[CursorStyleDefault])
s.emitVtString(vtEnableAm) s.emitVtString(vtEnableAm)
if !s.disableAlt {
s.emitVtString(vtExitCA)
}
} else if !s.disableAlt {
s.clearScreen(StyleDefault, s.vten)
} }
s.setInMode(s.oimode) s.setInMode(s.oimode)
s.setOutMode(s.oomode) s.setOutMode(s.oomode)
s.setBufferSize(int(s.oscreen.size.x), int(s.oscreen.size.y)) s.setBufferSize(int(s.oscreen.size.x), int(s.oscreen.size.y))
s.clearScreen(StyleDefault, false)
s.setCursorPos(0, 0, false) s.setCursorPos(0, 0, false)
s.setCursorInfo(&s.ocursor) s.setCursorInfo(&s.ocursor)
_, _, _ = procSetConsoleTextAttribute.Call( _, _, _ = procSetConsoleTextAttribute.Call(
uintptr(s.out), uintptr(s.out),
uintptr(s.mapStyle(StyleDefault))) uintptr(s.mapStyle(StyleDefault)))
if s.vten && !s.disableAlt {
s.emitVtString(vtExitCA)
}
} }
func (s *cScreen) engage() error { func (s *cScreen) engage() error {