mirror of
https://github.com/junegunn/fzf.git
synced 2026-10-26 20:16:32 +00: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:
1 parent
9c21a20f8b
commit
c21e9edad4
1 file changed
+3
@@ -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]
|
||||||
|
|||||||
Reference in new issue
Block a user