From 14bc04d6bbe900b52b84cc35dc56ebeb1a71e944 Mon Sep 17 00:00:00 2001 From: bjorndm Date: Sat, 12 Aug 2023 23:12:42 +0900 Subject: [PATCH] Fix underlines in Windows console mode. The ENABLE_LVB_GRID_WORLDWIDE is neede to enable them. --- console_win.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/console_win.go b/console_win.go index 5f0063e..d2307f8 100644 --- a/console_win.go +++ b/console_win.go @@ -231,7 +231,7 @@ func (s *cScreen) Init() error { // 24-bit color is opt-in for now, because we can't figure out // to make it work consistently. if s.truecolor { - s.setOutMode(modeVtOutput | modeNoAutoNL | modeCookedOut) + s.setOutMode(modeVtOutput | modeNoAutoNL | modeCookedOut | modeUnderline) var om uint32 s.getOutMode(&om) if om&modeVtOutput == modeVtOutput { @@ -334,7 +334,7 @@ func (s *cScreen) engage() error { s.enableMouse(s.mouseEnabled) if s.vten { - s.setOutMode(modeVtOutput | modeNoAutoNL | modeCookedOut) + s.setOutMode(modeVtOutput | modeNoAutoNL | modeCookedOut | modeUnderline) } else { s.setOutMode(0) } @@ -1213,6 +1213,8 @@ const ( modeCookedOut uint32 = 0x0001 modeVtOutput = 0x0004 modeNoAutoNL = 0x0008 + // ENABLE_LVB_GRID_WORLDWIDE, needed to make underlines actually work. + modeUnderline = 0x0010 // modeWrapEOL = 0x0002 )