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:
@@ -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