commercialhaskell / stack

The Haskell Tool Stack
http://haskellstack.org
BSD 3-Clause "New" or "Revised" License
4k stars 843 forks source link

Proposal: Have long ghc output piped to pager. #3822

Open kindaro opened 6 years ago

kindaro commented 6 years ago

When ghc detects errors in code, there may be long output to the console that's often more sensible to read from the top, so, when repeatedly failing to correct my code, I have every run to scroll up frantically until I find the beginning of the output. Sometimes I may even miss it and scroll to the beginning of the previous output, which is not good. I salvage the problem by piping the output to less. However, it is not so customary to pipe output from commands such as stack test --file-watch.

git invokes a pager by default for commands like git diff, if the output is a terminal and there are more lines to be put out than would fit. I've never heard any complaints about this behaviour; everyone seems to like it. Can we add the same feature to stack? I think it would be beautiful to have incremental logging (such as when building numerous dependencies) written to console, while putting long output of ghc, and perhaps test as well, to a pager.

mgsloan commented 6 years ago

Hmm, yeah, we already have some pager code. So this would just be a matter of hooking it up.

Not sure about making it a default. Could try it out and see if people like it.