blinksh / blink

Blink Mobile Shell for iOS (Mosh based)
https://blink.sh
GNU General Public License v3.0
6.1k stars 566 forks source link

ssh piped output includes STDERR output #1354

Open sukima opened 2 years ago

sukima commented 2 years ago

Checklist

Configuration

Hardware iPad Air (4th generation)
iPadOS 15.1
Blink.sh 14.0.3

Describe the bug

I often transfer data between machines via pipes.

blink> ssh myserver "echo test" | pbcopy

This works flawlessly but unfortunately both STDOUT and STDERR are captured from the SSH command.

Expected

SSH connection info should be routed to STDERR and not included in the STDOUT when piping.

In the example above the clipboard should contain the text: test.

Actual

Both the SSH connection info and the output are routed to STDOUT.

In the example above the clipboard contains the text:

Connected to 192.168.1.1
test
sukima commented 2 years ago

I think this might affect piping non-text data to pbcopy. For example if I were to…

blink> ssh myserver "cat foobar.jpg" | pbcopy
sukima commented 2 years ago

I should also add I use this feature a lot as a way to move clipboard data between machine using a server as an intermediary. On the server I create a named pipe mkfifo ~/hopper.

Machine A

(machine-a)$ pbpaste | ssh myserver "cat >> ~/hopper"

iPad (Blink)

blink> ssh myserver "cat ~/hopper" | pbcopy

Also can do in reverse to move clipboard data from iPad to another machine.

sukima commented 2 months ago

Is there a better place or method to report this bug? Should it be routed to a dependency of the project instead of this repo?

Any hints on where this might be coming from? Any thoughts. on next actions?

Thanks.