mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:47:45 +00:00
watch: Use stdout rather than stderr to display output
Previously, the header was printed to stderr. This matches the behavior of watch on Linux.
This commit is contained in:
parent
2f3c41e033
commit
ba1c4bc1d1
1 changed files with 6 additions and 6 deletions
|
@ -132,19 +132,19 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
|
|
||||||
auto watch_callback = [&] {
|
auto watch_callback = [&] {
|
||||||
// Clear the screen, then reset the cursor position to the top left.
|
// Clear the screen, then reset the cursor position to the top left.
|
||||||
warn("\033[H\033[2J");
|
out("\033[H\033[2J");
|
||||||
// Print the header.
|
// Print the header.
|
||||||
if (!flag_noheader) {
|
if (!flag_noheader) {
|
||||||
warnln("{}", header);
|
outln("{}", header);
|
||||||
warnln();
|
outln();
|
||||||
} else {
|
} else {
|
||||||
fflush(stderr);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
if (run_command(command) != 0) {
|
if (run_command(command) != 0) {
|
||||||
exit_code = 1;
|
exit_code = 1;
|
||||||
if (flag_beep_on_fail) {
|
if (flag_beep_on_fail) {
|
||||||
warnln("\a");
|
out("\a");
|
||||||
fflush(stderr);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue