Closed grosser closed 5 years ago
Could you provide some sample code that illustrates what you are trying to accomplish? I am not sure I understand from your description.
If you're asking a general Ruby question about whether you can test that $stdin
is in noecho mode, then this should work:
require "io/console"
IO.console.echo?
I'm trying to determine it for the channel that is passed to def on_stdout(channel, data)
If you are interacting with channels then you are dealing with the underlying net-ssh API. Unfortunately this is outside of my area of expertise. You could try asking in that repo: https://github.com/net-ssh/net-ssh
thx, I'll dig deeper there if I need to :)
I'm currently sending the password when a prompt shows on stdout, but it would be nice if I could refuse to send the password unless stdin is in noecho mode, is that possible ?