Permalink
Browse files

Merge pull request #95 from fgalassi/fix_eoferror_exception

fix EOFError repeatedly returned by HighLine::ask on stock osx ruby
  • Loading branch information...
2 parents 132ba8b + 14c45f2 commit 0aee8d5b440584fa82b340bc5d49735df5839e52 @igrigorik committed Aug 22, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/vimgolf/ui.rb
View
@@ -1,5 +1,7 @@
require 'highline'
+HighLine.track_eof = false
+
module VimGolf
class CLI
class UI < Thor::Base.shell
@@ -58,7 +60,9 @@ def ask_question(message, options = {})
end
@hl.ask(message, options[:choices] || [], &details)
rescue EOFError
- return ''
+ # be sure to exit, don't loop
+ error "Argh! Forced quit due to EOF error. Please report this problem so we can fix it!"
+ return :quit
end
end

0 comments on commit 0aee8d5

Please sign in to comment.