Russh client to open a pty

Hi there... i have a question about russh but the context is pretty general.

Russh opens so called channels within a ssh session. These channels can be used for port forwarding or generic to handle commands or even request a pty.

Trying to simulate a normal ssh client i want to open a pty and use stdin and stdout for this pty.

But: both reading from stdin and from ssh channel are blocking.
So the first idea is: spawn two tokio tasks.

Here's where i got stuck. For one task i need channel immutable (to read the output of the pty) and one task needs a mutable channel to send data from stdin.

What's the right way to handle this the rust way? I'd be grateful for a small hint to continue my lesrning experience, but the examples given on their repository don't cover pty/looping

I'd recommend sharing the code snippet in question. Show us what you've already done.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.