m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-16 23:33:39 -05:00

Restore VT hack for Windows (#2580)

- restore VT enable hack
- resolve an issue reported in https://github.com/kelleyma49/PSFzf
This commit is contained in:
Michael Kelley
2021-08-15 00:01:50 -07:00
committed by GitHub
parent 9c21a20f8b
commit c21e9edad4

View File

@@ -73,6 +73,9 @@ func (r *LightRenderer) initPlatform() error {
fd := int(r.inHandle) fd := int(r.inHandle)
b := make([]byte, 1) b := make([]byte, 1)
for { 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) _, err := util.Read(fd, b)
if err == nil { if err == nil {
r.ttyinChannel <- b[0] r.ttyinChannel <- b[0]