I\'m trying to do the opposite of \"Detect if stdin is a terminal or pipe?\".
I\'m running an application that\'s changing its output format because it detects a pip
I was trying to get colors when running shellcheck
, so I tried the above answers, but they produce this bizarre effect where text is horizontally offset from where it should be:
In ./all/update.sh line 6:
for repo in $(cat repos); do
^-- SC2013: To read lines rather than words, pipe/redirect to a 'while read' loop.
(For those unfamiliar with shellcheck, the line with the warning is supposed to line up with the where the problem is.)
In order to the answers above to work with shellcheck, I tried one of the options from the comments:
faketty() {
0
This works. I also added --return
and used long options, to make this command a little less inscrutable:
faketty() {
0
Works in Bash and Zsh.