Skip to content

Commit 72abd2a

Browse files
committed
nix ps: Check whether stdout is a tty
1 parent 33a856f commit 72abd2a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/nix/ps.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ struct CmdPs : MixJSON, StoreCommand
137137
}
138138
}
139139

140-
auto width = isTTY() ? getWindowWidth() : std::numeric_limits<unsigned int>::max();
140+
auto width = isTTY() && isatty(STDOUT_FILENO) ? getWindowWidth() : std::numeric_limits<unsigned int>::max();
141141

142142
printTable(std::cout, table, width);
143143
}

0 commit comments

Comments
 (0)