Skip to content

Commit b044640

Browse files
committed
feat(run): remove terminal clear and spinner for clean runtime output
- disable terminal clearing in run command - remove spinner rendering and overwrite behavior - ensure raw stdout/stderr passthrough (no UI interference) - silence unused parameter warnings in spinner stubs align runtime UX with modern tools (node, deno, bun)
1 parent 6303783 commit b044640

File tree

2 files changed

+11
-46
lines changed

2 files changed

+11
-46
lines changed

src/commands/RunCommand.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,7 @@ namespace
4040
{
4141
static bool should_clear_terminal_now()
4242
{
43-
const char *mode = vix::utils::vix_getenv("VIX_CLI_CLEAR");
44-
if (!mode || !*mode)
45-
mode = "auto";
46-
47-
if (std::strcmp(mode, "never") == 0)
48-
return false;
49-
50-
#ifndef _WIN32
51-
if (std::strcmp(mode, "auto") == 0)
52-
return ::isatty(STDOUT_FILENO) != 0;
53-
#endif
54-
55-
return true;
43+
return false;
5644
}
5745

5846
static std::string trim_copy_local(std::string s)

src/commands/run/RunProcess.cpp

Lines changed: 10 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -376,19 +376,10 @@ namespace vix::commands::RunCommand::detail
376376
static bool should_clear()
377377
{
378378
const char *mode = vix::utils::vix_getenv("VIX_CLI_CLEAR");
379-
if (!mode || !*mode)
380-
mode = "auto";
381-
382-
if (std::strcmp(mode, "never") == 0)
379+
if (!mode)
383380
return false;
384381

385-
if (std::strcmp(mode, "always") == 0)
386-
return true;
387-
388-
if (std::strcmp(mode, "auto") == 0)
389-
return ::isatty(STDOUT_FILENO) != 0;
390-
391-
return false;
382+
return std::strcmp(mode, "1") == 0;
392383
}
393384

394385
static std::size_t find_first_vix_marker(const std::string &text)
@@ -614,30 +605,16 @@ namespace vix::commands::RunCommand::detail
614605
bool &printedSomething,
615606
char &lastPrintedChar)
616607
{
617-
static const char *frames[] = {"", "", "", "", "", "", "", "", "", ""};
618-
const std::size_t frameCount = sizeof(frames) / sizeof(frames[0]);
619-
620-
std::string line = "\r";
621-
line += frames[frameIndex];
622-
line += " ";
623-
line += label;
624-
line += " ";
625-
626-
write_all(STDOUT_FILENO, line.c_str(), line.size());
627-
628-
printedSomething = true;
629-
lastPrintedChar = '\r';
630-
631-
frameIndex = (frameIndex + 1) % frameCount;
608+
(void)label;
609+
(void)frameIndex;
610+
(void)printedSomething;
611+
(void)lastPrintedChar;
632612
}
633613

634614
static inline void spinner_clear(bool &printedSomething, char &lastPrintedChar)
635615
{
636-
const char *clearLine = "\r\033[2K\r";
637-
write_all(STDOUT_FILENO, clearLine, std::strlen(clearLine));
638-
639-
printedSomething = true;
640-
lastPrintedChar = '\r';
616+
(void)printedSomething;
617+
(void)lastPrintedChar;
641618
}
642619

643620
static bool is_sanitizer_abort_banner_line(std::string_view line) noexcept
@@ -767,9 +744,9 @@ namespace vix::commands::RunCommand::detail
767744
close_safe(slaveFd);
768745
::setpgid(pid, pid);
769746

770-
const bool useSpinner = !spinnerLabel.empty();
747+
const bool useSpinner = false;
771748
const bool captureOnly = false;
772-
bool spinnerActive = useSpinner;
749+
bool spinnerActive = false;
773750
std::size_t frameIndex = 0;
774751

775752
RuntimeOutputFilter runtimeFilter;

0 commit comments

Comments
 (0)