Use automargin disable

This commit is contained in:
Garrett D'Amore 2024-03-02 12:02:40 -08:00
parent f6c43a3372
commit 5a591d4275
1 changed files with 4 additions and 0 deletions

View File

@ -159,6 +159,8 @@ const (
vtCursorSteadyUnderline = "\x1b[4 q" vtCursorSteadyUnderline = "\x1b[4 q"
vtCursorBlinkingBar = "\x1b[5 q" vtCursorBlinkingBar = "\x1b[5 q"
vtCursorSteadyBar = "\x1b[6 q" vtCursorSteadyBar = "\x1b[6 q"
vtDisableAm = "\x1b[?7l"
vtEnableAm = "\x1b[?7h"
) )
var vtCursorStyles = map[CursorStyle]string{ var vtCursorStyles = map[CursorStyle]string{
@ -324,6 +326,7 @@ func (s *cScreen) disengage() {
if s.vten { if s.vten {
s.emitVtString(vtCursorStyles[CursorStyleDefault]) s.emitVtString(vtCursorStyles[CursorStyleDefault])
s.emitVtString(vtEnableAm)
} }
s.setInMode(s.oimode) s.setInMode(s.oimode)
s.setOutMode(s.oomode) s.setOutMode(s.oomode)
@ -357,6 +360,7 @@ func (s *cScreen) engage() error {
if s.vten { if s.vten {
s.setOutMode(modeVtOutput | modeNoAutoNL | modeCookedOut | modeUnderline) s.setOutMode(modeVtOutput | modeNoAutoNL | modeCookedOut | modeUnderline)
s.emitVtString(vtDisableAm)
} else { } else {
s.setOutMode(0) s.setOutMode(0)
} }