Shell: Print paths in plain mode when stdout is not a tty

This makes e.g. `pwd | ...` behave as expected, where pwd doesn't add a
hyperlink around the path.
This commit is contained in:
Ali Mohammad Pur 2024-01-12 14:57:09 +03:30 committed by Andreas Kling
parent 06f7f549f2
commit da5b1680bb
Notes: sideshowbarker 2024-07-16 20:44:03 +09:00

View file

@ -72,7 +72,7 @@ void Shell::setup_signals()
void Shell::print_path(StringView path)
{
if (s_disable_hyperlinks || !m_is_interactive) {
if (s_disable_hyperlinks || !m_is_interactive || !isatty(STDOUT_FILENO)) {
out("{}", path);
return;
}