quantumsheep / sshs

Terminal user interface for SSH
MIT License
910 stars 27 forks source link

Support for SSH alias #48

Closed adrianmihalko closed 7 months ago

adrianmihalko commented 1 year ago

I am using kitty and I would like to use it's own shell integration, so I need to use ssh like: kitty +kitten ssh name@host.

I created alias for this command:

alias ssh="kitty +kitten ssh"

I thought it might work from sshs, but it's not. Does sshs call ssh command directly from /usr/bin/ssh?

BhaveshDiwan commented 1 year ago

+1 My suggestion would be to be able to provide the binary, perhaps with it's flags via the config file, say $XDG_CONFIG_HOME/.sshs

ssh_agent="/opt/homebrew/bin/kitty +kitten ssh"

quantumsheep commented 11 months ago

Hey! It's due to os/exec not using the shell but a child process directly.

There are solutions but not good solutions that will fit all cases. I might add an --executable option to pass anything you want to.

quantumsheep commented 7 months ago

Hey! In 4.0.0 I introduced --template, you can now do handlebars templating:

sshs --template "kitty +kitten ssh {{#if user}}{{user}}@{{/if}}{{destination}}{{#if port}} -p {{port}}{{/if}}"