2
0
mirror of https://github.com/junegunn/fzf synced 2024-11-12 07:11:11 +00:00

Use IO.console when possible

This commit is contained in:
Junegunn Choi 2014-10-07 11:49:40 +09:00
parent 4c923a2d19
commit d1387bf512

8
fzf
View File

@ -841,7 +841,13 @@ class FZF
end
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
@pending = nil