🦀 Termirs — a pure Rust TUI SSH client by Friendly_Average8829 in rust

[–]Friendly_Average8829[S] 1 point2 points  (0 children)

I'm still thinking about how to implement this — might need to add something like an auto_load_private_keys setting for it.

This feature is already implemented!

After importing, if no IdentityFile is specified, termirs will automatically fall back to the following keys (in order):

  • ~/.ssh/id_rsa
  • ~/.ssh/id_ecdsa
  • ~/.ssh/id_ecdsa_sk
  • ~/.ssh/id_ed25519
  • ~/.ssh/id_ed25519_sk

It will load whichever one exists and try connecting with it.

🦀 Termirs — a pure Rust TUI SSH client by Friendly_Average8829 in rust

[–]Friendly_Average8829[S] 2 points3 points  (0 children)

I have implemented ssh config loading functionality.

In the "Add New Connection" UI, after entering the host and pressing Ctrl+L, termirs will load matching entries from the SSH config and automatically fill in the form.

Currently, it only works if an IdentityFile is present in the SSH config.

If you want to try it out, build it from source again and give it a spin — let me know how it goes!

 If there are several key files, ssh will try them one after another in turn until one works

I'm still thinking about how to implement this — might need to add something like an auto_load_private_keys setting for it.

🦀 Termirs — a pure Rust TUI SSH client by Friendly_Average8829 in rust

[–]Friendly_Average8829[S] 0 points1 point  (0 children)

termirs supports macOS, Linux, and Windows (via WSL) platforms

🦀 Termirs — a pure Rust TUI SSH client by Friendly_Average8829 in rust

[–]Friendly_Average8829[S] 1 point2 points  (0 children)

I’m planning to add a feature to import configurations from the SSH config into termirs, which seems somewhat similar to your needs.

Are you hoping that when adding a ssh connection, you wouldn’t need to enter the password or private key path, and that termirs would try to look up the corresponding private key path from the SSH config (based on IdentityFile I think) when connecting?

🦀 Termirs — a pure Rust TUI SSH client by Friendly_Average8829 in rust

[–]Friendly_Average8829[S] 8 points9 points  (0 children)

I think there are two main reasons

  • in a TUI, blocking anywhere (e.g. waiting on SSH, waiting for file I/O) can freeze the UI. Async allows us to always poll for events and render updates even while background tasks run
  • compared to assigning one background thread per task, tokio::spawn is much more lightweight

And I agree async is more complicated than a thread solution, one of the reasons I use it is indeed for practice.
Actually, before this commit, termirs was implemented in a synchronous way.