-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interact on Mac doesn't print what's being typed #48
Comments
Hi @psymole Thank you for opening the issue. I don't have mac unfortunately so it will take me a while to debug. Which I am not sure why even exists. That's said.... sh.send_line("stty echo").unwrap(); Perhaps I need to investigate it further. ref: #10 |
@zhiburt Your suggestion worked when I placed it before running SSH. Thanks a lot. For what it is worth, I didn't see the issue on my Ubuntu 22.04 test machine. I can spawn bash and then ssh. Or ssh directly, and in both cases the user's input is visible. A couple of questions if you don't mind.
Again thanks for all the help. |
Really?
But doesn't it work if you would call
I bet it could be possible somehow through bash using But sticking to your snippet you can just call |
Thanks!
bash --version If I run the previous snippet on a Mac; I get SSH, but I cannot see what I type.
But it still didn't work until I added your "workaround"
Trying to spawn("ssh admin@localhost") on the mac always produces the same issue. Can't see what I type. macOS 12 Thanks |
Interact won't finish until I stop the bash session that I spawned, Correct? Rust main > Spawn bash session (interact) > Spawn SSH session. |
Now I see what the issue is. I guess it can be done in may ways.
|
That's interesting. use std::io::stdout;
use expectrl::{spawn, stream::stdin::Stdin};
fn main() {
let mut sh = spawn("bash").unwrap();
sh.send_line("echo Hello World").unwrap();
sh.expect("Hello World").unwrap();
let mut stdin = Stdin::open().expect("Failed to create stdin");
sh.interact(&mut stdin, stdout())
.spawn()
.expect("Failedsd to start interact");
stdin.close().expect("Failed to close a stdin");
println!("Done");
} |
Thank you Could you try a different terminal? (like |
Hi,
I'm trying to use expectrl to interact with a ssh password prompt on macOS (vers 12 if it matters)
everything works but after the ssh session gets initialized the user input is not "printed" on the command line.
Input is being passed to the ssh session, but it is invisible to the user.
Example:
netadmin@CO-90062106: ______________<--- command is not visible
But it produces the expected return when return is pressed.
This code reproduces the issue
The text was updated successfully, but these errors were encountered: