Skip to content

Commit dfb0085

Browse files
Clearing console for watch mode
1 parent 92441fe commit dfb0085

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Src/runcpp2/main.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
#include "ghc/filesystem.hpp"
88

9-
109
//TODO: Merge long and short options into a single structure
1110
int ParseArgs( const std::unordered_map<std::string, runcpp2::OptionInfo>& longOptionsMap,
1211
const std::unordered_map<std::string, const runcpp2::OptionInfo&>& shortOptionsMap,
@@ -446,6 +445,17 @@ int main(int argc, char* argv[])
446445

447446
if(needsRunning)
448447
{
448+
//Clear the screen
449+
if(ssLOG_GET_CURRENT_THREAD_TARGET_LEVEL() <= ssLOG_LEVEL_WARNING)
450+
{
451+
#if defined(_WIN32)
452+
system("cls");
453+
#else
454+
//https://stackoverflow.com/a/53925508
455+
std::cout << "\033c";
456+
#endif
457+
}
458+
449459
int result = 0;
450460
runcpp2::PipelineResult pipelineResult =
451461
runcpp2::StartPipeline( script,

0 commit comments

Comments
 (0)