PaddiM8 / kalker

Scientific calculator with math syntax that supports user-defined variables and functions, complex numbers, and estimation of derivatives and integrals
https://kalker.xyz
MIT License
1.59k stars 70 forks source link

Enhancement request: configuration file or environment variable to disable startup banner #29

Closed kseistrup closed 3 years ago

kseistrup commented 3 years ago

When launched without any arguments, kalk will write a banner and a help hint to standard output. This is counter productive when kalk is used as a filter, because you cannot easily use the output from kalk in a pipe — even when output is a file, the banner/help is irrelevant.

Without thinking it through completely, I think kalk could just check if stdin and stdout are TTYs (isatty(3)) and only display banner/help if they both are: when reading expressions from stdin, stdin is not a TTY, and when writing to a pipe or a file, stdout is not a TTY.

PaddiM8 commented 3 years ago

Yeah I just realised this from your other issue as well, this should definitely be fixed asap. Thank you.

PaddiM8 commented 3 years ago

Checking if stdin and stdout are TTYs seems to have done the trick :) Thanks!