Skip to content

Commit

Permalink
Windows: enable VT mode output by default
Browse files Browse the repository at this point in the history
The special environment variable TCELL_VTMODE may be set to "disable"
to return to legacy console mode.  (This environment variable may
be removed in the future, if we determine it is no longer useful.)
  • Loading branch information
gdamore committed Mar 2, 2024
1 parent d17cf8b commit cd0fe98
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions console_win.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ func (s *cScreen) Init() error {
s.eventQ = make(chan Event, 10)
s.quit = make(chan struct{})
s.scandone = make(chan struct{})

in, e := syscall.Open("CONIN$", syscall.O_RDWR, 0)
if e != nil {
return e
Expand Down Expand Up @@ -227,9 +226,10 @@ func (s *cScreen) Init() error {
s.fini = false
s.setInMode(modeResizeEn | modeExtendFlg)

// 24-bit color is opt-in for now, because we can't figure out
// to make it work consistently.
if s.truecolor {
// 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.
// It may be removed in the future. (This mostly exists because of ConEmu.)
if os.Getenv("TCELL_VTMODE") != "disable" {
s.setOutMode(modeVtOutput | modeNoAutoNL | modeCookedOut | modeUnderline)
var om uint32
s.getOutMode(&om)
Expand Down

0 comments on commit cd0fe98

Please sign in to comment.