Skip to content
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

ninja build files lacks of line feed #2379

Open
jdai opened this issue Jan 31, 2024 · 1 comment
Open

ninja build files lacks of line feed #2379

jdai opened this issue Jan 31, 2024 · 1 comment
Labels
Milestone

Comments

@jdai
Copy link

jdai commented Jan 31, 2024

similar problem: https://stackoverflow.com/questions/46970462/how-to-enable-multiline-logs-instead-of-single-line-progress-logs

ninja

I read lineprinter.cc, woul dit be the 1st line below lacks of "\n"?
printf("%s", to_print.c_str());
printf("\x1B[K"); // Clear to end of line.
fflush(stdout);
#endif

have_blank_line_ = false;

} else {
printf("%s\n", to_print.c_str());
}

================
OS Name Microsoft Windows 11 Enterprise
Version 10.0.22631 Build 22631

PS E:\repos\king> git --version
git version 2.43.0.windows.1


PS E:\repos\king> $PSVertionTable; $Host
Name : ConsoleHost
Version : 5.1.22621.2506
InstanceId : ad82b908-ad36-4994-8241-d9be350b2825
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : en-US
CurrentUICulture : en-US
PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled : True
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspace

@digit-google
Copy link
Contributor

This is working as intended.

The purpose of the code you are showing is to replace the content of the current line, without jumping to the next one. This is how Ninja displays its status when it is run in an interactive terminal (but not when invoked from a script, or when its output is piped to another command).

You can use ninja ... | cat on Posix to avoid this (in this case each status line is printed in its own separate line), or ninja .. > CON on Windows (same result).

Another way is to declare TERM=dumb in your environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants