You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I run yes | time cat lkslkjlklkslsj (where the file passed to cat is non-existent), I get a prompt back immediately, nothing appears on standard error, and the exit status ($status) is 2. The same thing happens if I run e.g., cat /etc/passwd | time cat lkslkjlk. When I do the same thing without time I get the expected message about a non-existent file on standard error from the cat and the exit status is 1. So it appears time has detected the non-zero exit status but suppressed the standard error output and it exits with 2.
Bizarrely, if I run echo hi | time cat lskjlsjsjlskjlskj, fish displays what I see when I run man time (including piping it to what seems to be more (not less which is what I have $PAGER set to))! Maybe because these are both builtin commands fish does something unexpected (at least to me).
The text was updated successfully, but these errors were encountered:
I would suggest (though I don't know who to) that time should not have the current behaviour if stdin is not a tty. It's obviously wrong for a fish user to do what I did (though the man page gives no indication of this, and the fish behaviour is not the behaviour of /usr/bin/time (which passes on the stdin and also prints the stderr of a failing command). So accepting that the fish version of time is going to behave as it does, it seems like it would be a good idea for it to tell you when you've made this error. Silently dropping the stderr output of the failing command seems quite wrong.
Anyway, I'm not sure who I should be saying this to, if anyone! Thanks again for the reply.
fish version 3.4.1 on OS X 12.2.1
If I run
yes | time cat lkslkjlklkslsj
(where the file passed tocat
is non-existent), I get a prompt back immediately, nothing appears on standard error, and the exit status ($status
) is 2. The same thing happens if I run e.g.,cat /etc/passwd | time cat lkslkjlk
. When I do the same thing withouttime
I get the expected message about a non-existent file on standard error from thecat
and the exit status is 1. So it appearstime
has detected the non-zero exit status but suppressed the standard error output and it exits with 2.Bizarrely, if I run
echo hi | time cat lskjlsjsjlskjlskj
, fish displays what I see when I runman time
(including piping it to what seems to bemore
(notless
which is what I have$PAGER
set to))! Maybe because these are both builtin commands fish does something unexpected (at least to me).The text was updated successfully, but these errors were encountered: