Skip to content

Commit

Permalink
Don't run the pager on Windows or when we're not talking to a terminal.
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed Mar 16, 2008
1 parent ae2c118 commit 7523458
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/cheat.rb
Expand Up @@ -165,7 +165,10 @@ def clear_cache
FileUtils.rm_rf(cache_dir) if cache_dir
end

def run_pager
def run_pager
return if PLATFORM =~ /win32/
return unless STDOUT.tty?

read, write = IO.pipe
STDIN.reopen(read)

Expand Down

0 comments on commit 7523458

Please sign in to comment.