ConEmu fixes - we cannot go to 24-bit mode on that yet.

This commit is contained in:
Garrett D'Amore 2024-03-02 11:55:11 -08:00
parent cd0fe984d9
commit f6c43a3372
1 changed files with 15 additions and 7 deletions

View File

@ -196,20 +196,22 @@ func (s *cScreen) Init() error {
s.truecolor = true s.truecolor = true
// ConEmu handling of colors and scrolling when in terminal // ConEmu handling of colors and scrolling when in VT output mode is extremely poor.
// mode is extremely problematic at the best. The color // The color palette will scroll even though characters do not, when
// palette will scroll even though characters do not, when // emitting stuff for the last character. In the future we might change this to
// emitting stuff for the last character. In the future we // look at specific versions of ConEmu if they fix the bug.
// might change this to look at specific versions of ConEmu // We can also try disabling auto margin mode.
// if they fix the bug. tryVt := true
if os.Getenv("ConEmuPID") != "" { if os.Getenv("ConEmuPID") != "" {
s.truecolor = false s.truecolor = false
tryVt = false
} }
switch os.Getenv("TCELL_TRUECOLOR") { switch os.Getenv("TCELL_TRUECOLOR") {
case "disable": case "disable":
s.truecolor = false s.truecolor = false
case "enable": case "enable":
s.truecolor = true s.truecolor = true
tryVt = true
} }
s.Lock() s.Lock()
@ -229,7 +231,13 @@ func (s *cScreen) Init() error {
// If a user needs to force old style console, they may do so // If a user needs to force old style console, they may do so
// by setting TCELL_VTMODE to disable. This is an undocumented safety net for now. // by setting TCELL_VTMODE to disable. This is an undocumented safety net for now.
// It may be removed in the future. (This mostly exists because of ConEmu.) // It may be removed in the future. (This mostly exists because of ConEmu.)
if os.Getenv("TCELL_VTMODE") != "disable" { switch os.Getenv("TCELL_VTMODE") {
case "disable":
tryVt = false
case "enable":
tryVt = true
}
if tryVt {
s.setOutMode(modeVtOutput | modeNoAutoNL | modeCookedOut | modeUnderline) s.setOutMode(modeVtOutput | modeNoAutoNL | modeCookedOut | modeUnderline)
var om uint32 var om uint32
s.getOutMode(&om) s.getOutMode(&om)