简体   繁体   中英

How can I clear console before build using stack with file watch

When doing significant refactoring using VSCode I have found running:

stack build --file-watch

in the integrated Powershell terminal invaluable. I was wondering if there was a way to somehow prepend a clear terminal command so I only see the last batch of errors.

Something like:

stack build --exec-before "cmd cls" --file-watch

Note exe-before is not a real stack command

Try ghcid . It's a program which does exactly what you want: run the appropriate command when a file changes, clearing the screen between changes. Have a look at this tutorial for more details. Plus, it looks like there's even a Visual Studio Code extension which runs it directly in the IDE!

There are a few extensions for VSCode which compile open files on the fly and populate PROBLEMS window with errors and warnings. From my personal experience I'd recommend Simple GHC which just works out of the box and quite stable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM