-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
build_runner: add option to clear console when watching #24122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,6 +110,7 @@ pub fn main() !void { | |
var steps_menu = false; | ||
var output_tmp_nonce: ?[16]u8 = null; | ||
var watch = false; | ||
var withClear = false; | ||
var fuzz = false; | ||
var debounce_interval_ms: u16 = 50; | ||
var listen_port: u16 = 0; | ||
|
@@ -266,6 +267,8 @@ pub fn main() !void { | |
prominent_compile_errors = true; | ||
} else if (mem.eql(u8, arg, "--watch")) { | ||
watch = true; | ||
} else if (mem.eql(u8, arg, "--with-clear")) { | ||
alexrp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
withClear = true; | ||
} else if (mem.eql(u8, arg, "--fuzz")) { | ||
fuzz = true; | ||
} else if (mem.eql(u8, arg, "-fincremental")) { | ||
|
@@ -484,6 +487,10 @@ pub fn main() !void { | |
var debounce_timeout: Watch.Timeout = .none; | ||
while (true) switch (try w.wait(gpa, debounce_timeout)) { | ||
.timeout => { | ||
if (withClear) { | ||
try std.io.getStdOut().writeAll("\x1B[2J\x1B[H"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In my opinion, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also note that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've looked at To me it feels like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
https://no-color.org seems to me to strongly indicate that it's about a preference of colored vs non-colored output, not terminal sequences in general. So I would say no. |
||
} | ||
|
||
debouncing_node.end(); | ||
markFailedStepsDirty(gpa, run.step_stack.keys()); | ||
continue :rebuild; | ||
|
Uh oh!
There was an error while loading. Please reload this page.