From da5b1680bb4cee50ac4ca999cfd3b86e64c28cb3 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Fri, 12 Jan 2024 14:57:09 +0330 Subject: [PATCH] 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. --- Userland/Shell/Shell.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Shell/Shell.cpp b/Userland/Shell/Shell.cpp index 2ce3184587..4156fa4a69 100644 --- a/Userland/Shell/Shell.cpp +++ b/Userland/Shell/Shell.cpp @@ -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; }