Prints everything to stderr instead of stdout
mye opened this issue · comments
This example prints nothing if run in bash:
Rscript - 2>/dev/null <<!
library(cowsay)
say("Hello, Kitty!", "stretchycat")
!
It means that even the kitty is going to stderr, which is IMO unexpected.
I found this after trying to silence an annoying "error" message that seems
to be printed unconditionally if the crayon package isn't run on a color terminal.
Colors cannot be applied in this environment :( Try using a terminal or RStudio.
I would humbly request to not treat animals as if they were errors, which is surely not in the spirit of this package, and to respect people who pefer uncolored pets on their text terminals by default (don't print the message, just don't output colors in this case).
Okay so according to the first answer here, message
prints to stderr by default where as print
and cat
got to stdout.
So we could add a new type
called "print"
and put something in such that when interactive()
is false, default to the "print"
type.
Why does it have to be stderr in interactive mode? (Maybe something about R I'm not aware of, but I don't see the point in putting the expected output on stderr).
So we could add a new type called "print" and put something in such that when interactive() is false, default to the "print" type.
sounds good @aedobbyn
@mye i don't know, that's just the way R is. i think we'd want to maintain idiomatic R here, while using @aedobbyn suggestion for non-interactive mode