Fix underlines in Windows console mode.

The ENABLE_LVB_GRID_WORLDWIDE is neede to enable them.
This commit is contained in:
bjorndm 2023-08-12 23:12:42 +09:00 committed by Garrett D'Amore
parent 47ec3a7775
commit 14bc04d6bb
1 changed files with 4 additions and 2 deletions

View File

@ -231,7 +231,7 @@ func (s *cScreen) Init() error {
// 24-bit color is opt-in for now, because we can't figure out // 24-bit color is opt-in for now, because we can't figure out
// to make it work consistently. // to make it work consistently.
if s.truecolor { if s.truecolor {
s.setOutMode(modeVtOutput | modeNoAutoNL | modeCookedOut) s.setOutMode(modeVtOutput | modeNoAutoNL | modeCookedOut | modeUnderline)
var om uint32 var om uint32
s.getOutMode(&om) s.getOutMode(&om)
if om&modeVtOutput == modeVtOutput { if om&modeVtOutput == modeVtOutput {
@ -334,7 +334,7 @@ func (s *cScreen) engage() error {
s.enableMouse(s.mouseEnabled) s.enableMouse(s.mouseEnabled)
if s.vten { if s.vten {
s.setOutMode(modeVtOutput | modeNoAutoNL | modeCookedOut) s.setOutMode(modeVtOutput | modeNoAutoNL | modeCookedOut | modeUnderline)
} else { } else {
s.setOutMode(0) s.setOutMode(0)
} }
@ -1213,6 +1213,8 @@ const (
modeCookedOut uint32 = 0x0001 modeCookedOut uint32 = 0x0001
modeVtOutput = 0x0004 modeVtOutput = 0x0004
modeNoAutoNL = 0x0008 modeNoAutoNL = 0x0008
// ENABLE_LVB_GRID_WORLDWIDE, needed to make underlines actually work.
modeUnderline = 0x0010
// modeWrapEOL = 0x0002 // modeWrapEOL = 0x0002
) )