Skip to content

Commit

Permalink
Restore VT hack for Windows (junegunn#2580)
Browse files Browse the repository at this point in the history
- restore VT enable hack
- resolve an issue reported in https://github.com/kelleyma49/PSFzf
  • Loading branch information
kelleyma49 authored Aug 15, 2021
1 parent 9c21a20 commit c21e9ed
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/tui/light_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ func (r *LightRenderer) initPlatform() error {
fd := int(r.inHandle)
b := make([]byte, 1)
for {
// HACK: if run from PSReadline, something resets ConsoleMode to remove ENABLE_VIRTUAL_TERMINAL_INPUT.
_ = windows.SetConsoleMode(windows.Handle(r.inHandle), consoleFlagsInput)

_, err := util.Read(fd, b)
if err == nil {
r.ttyinChannel <- b[0]
Expand Down

0 comments on commit c21e9ed

Please sign in to comment.