ndmitchell / hoogle

Haskell API search engine
http://hoogle.haskell.org/
Other
753 stars 137 forks source link

Progress indication for non-terminals #231

Closed nponeccop closed 6 years ago

nponeccop commented 6 years ago

Currently hoogle generate looks pretty ugly if it writes to a file and/or the terminal is broken. For example it's how it looks on CircleCI build log if hoogle generate is executed during a build:

~/.local/bin/hoogle generate
Starting generate
Reading Cabal... 9.79s
[1/2523] AC-Vector... 0.04s                           [2/2523] IfElse... 0.00s                        [3/2523] Imlib... 0.04s                       [4/2523] NineP... 0.02s                       [5/2523] OneTuple... 0.06s                          [6/2523] PSQueue... 0.01s                         [7/2523] ParsecTools... 0.00s                             [8/2523] SegmentTree... 0.00s                             [9/2523] X11-xft... 0.01s                         [10/2523] Xauth... 0.00

Visually it's like this:

image

My suggestion is to have a simpler progress indicator designed for logs and incorrect terminal emulators. Something along the lines of --no-terminal option of stack.

ndmitchell commented 6 years ago

Sounds sensible - I'd happily accept a PR. One option would be using the hSupportsANSI from ansi-terminal or isTerminal from base (I'm happy either way).

maikf commented 6 years ago

This seems to have been fixed since 5245f28baa12638b06c660c34df66867e88f892c.

ndmitchell commented 6 years ago

Oh, awesome! Closing optimistically.