trzsz / trzsz-ssh

trzsz-ssh ( tssh ) is an ssh client designed as a drop-in replacement for the openssh client. It aims to provide complete compatibility with openssh, mirroring all its features, while also offering additional useful features. Such as login prompt, batch login, remember password, automated interaction, trzsz, zmodem(rz/sz), udp mode like mosh, etc.
https://trzsz.github.io/ssh
MIT License
1.74k stars 102 forks source link

It might be better to output version and help to stdout #136

Open lonnywong opened 2 months ago

lonnywong commented 2 months ago

Related to https://github.com/Homebrew/homebrew-core/pull/181568.

kke commented 2 months ago

Yes.

Stdout = Information that user requested, interactive elements, payload Stderr = Diagnostics, logging, errors, stuff you don't want to include when capturing/redirecting payload

Things like foo --help | less, foo --help | grep -i color and foo --version | grep -q v1.20. should work without redirecting stderr to stdout.

lonnywong commented 2 months ago

The openssh client outputs version and help message to stderr.

/usr/bin/ssh 1>/tmp/ssh.stdout 2>/tmp/ssh.stderr
/usr/bin/ssh -V 1>/tmp/ssh.stdout 2>/tmp/ssh.stderr
/usr/bin/ssh -h 1>/tmp/ssh.stdout 2>/tmp/ssh.stderr

The output goes to /tmp/ssh.stderr, but not /tmp/ssh.stdout.