mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-12-23 11:29:01 +00:00
Use IO.console when possible
This commit is contained in:
parent
4c923a2d19
commit
d1387bf512
8
fzf
8
fzf
@ -841,7 +841,13 @@ class FZF
|
|||||||
end
|
end
|
||||||
|
|
||||||
def get_input actions
|
def get_input actions
|
||||||
@tty ||= IO.open(IO.sysopen('/dev/tty'), 'r')
|
@tty ||=
|
||||||
|
begin
|
||||||
|
require 'io/console'
|
||||||
|
IO.console
|
||||||
|
rescue LoadError
|
||||||
|
IO.open(IO.sysopen('/dev/tty'), 'r')
|
||||||
|
end
|
||||||
|
|
||||||
if pending = @pending
|
if pending = @pending
|
||||||
@pending = nil
|
@pending = nil
|
||||||
|
Loading…
Reference in New Issue
Block a user