Skip to content

Commit

Permalink
fix(windows): we need to ensure that newline auto return is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas authored and meowgorithm committed Oct 11, 2024
1 parent 69b96af commit 7abded1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tty_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ func (p *Program) initInput() (err error) {
return fmt.Errorf("error getting console mode: %w", err)
}

if err := windows.SetConsoleMode(windows.Handle(p.ttyOutput.Fd()), mode|windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING); err != nil {
if err := windows.SetConsoleMode(windows.Handle(p.ttyOutput.Fd()),
mode|windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING|
windows.DISABLE_NEWLINE_AUTO_RETURN); err != nil {
return fmt.Errorf("error setting console mode: %w", err)
}
}
Expand Down

0 comments on commit 7abded1

Please sign in to comment.