Skip to content

Commit

Permalink
Fix underlines in Windows console mode.
Browse files Browse the repository at this point in the history
The ENABLE_LVB_GRID_WORLDWIDE is neede to enable them.
  • Loading branch information
bjorndm authored and gdamore committed Aug 12, 2023
1 parent 47ec3a7 commit 14bc04d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions console_win.go
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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
)

Expand Down

0 comments on commit 14bc04d

Please sign in to comment.