rua icon indicating copy to clipboard operation
rua copied to clipboard

consider tty availability to decide switching to /dev/stdin for shellcheck

Open vn971 opened this issue 5 years ago • 0 comments

Currently, if you invoke rua shellcheck (without the last argument), rua will take /dev/stdin as its argument. That might generally be a good idea if you want to use the tool like cat file | rua shellcheck (also known as rua shellcheck < file). But if you didn't pipe any file in, rua shellcheck will be stuck waiting for user-s input, same as a bare cat will do.

The proposal is to make a tty check and exit early if it is available (nothing is piped in).

P.S. Also need to verify if tty-s indeed works as I describe. I'm not 100% sure myself, but I expect so.

vn971 avatar Apr 15 '20 08:04 vn971