Skip to content

Commit

Permalink
Try not to clear screen on Windows if TCELL_ALTSCREEN=disable
Browse files Browse the repository at this point in the history
  • Loading branch information
gdamore committed Mar 2, 2024
1 parent 6984e25 commit 6c95e8d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions console_win.go
Expand Up @@ -336,19 +336,20 @@ func (s *cScreen) disengage() {
if s.vten {
s.emitVtString(vtCursorStyles[CursorStyleDefault])
s.emitVtString(vtEnableAm)
if !s.disableAlt {
s.emitVtString(vtExitCA)
}
} else if !s.disableAlt {
s.clearScreen(StyleDefault, s.vten)
}
s.setInMode(s.oimode)
s.setOutMode(s.oomode)
s.setBufferSize(int(s.oscreen.size.x), int(s.oscreen.size.y))
s.clearScreen(StyleDefault, false)
s.setCursorPos(0, 0, false)
s.setCursorInfo(&s.ocursor)
_, _, _ = procSetConsoleTextAttribute.Call(
uintptr(s.out),
uintptr(s.mapStyle(StyleDefault)))
if s.vten && !s.disableAlt {
s.emitVtString(vtExitCA)
}
}

func (s *cScreen) engage() error {
Expand Down

0 comments on commit 6c95e8d

Please sign in to comment.