Skip to content
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

Have shell completion for kssh work the same as ssh #5322

Closed
grimm26 opened this issue Jul 27, 2022 · 6 comments
Closed

Have shell completion for kssh work the same as ssh #5322

grimm26 opened this issue Jul 27, 2022 · 6 comments

Comments

@grimm26
Copy link
Contributor

grimm26 commented Jul 27, 2022

Is your feature request related to a problem? Please describe.
First off, I use zsh.
I would like command completion for kssh work the same as when I use ssh. For instance, when I start typing kssh some.host -i ~/.ssh/ and hit , nothing happens. If I change kssh to ssh then go to the end of the line and hit I get completion for the directories and files under ~/.ssh.

Describe the solution you'd like
Have command completion for kssh work like that of ssh.

I've tried just doing compdef _ssh kssh but that did not help.

@kovidgoyal
Copy link
Owner

If that's the completion you are getting for ssh that completion is
incorrect. Arguments after the host name are executed on the remote
host, so it is meaningless to complete them from local files and
directories.

@grimm26
Copy link
Contributor Author

grimm26 commented Jul 28, 2022

If that's the completion you are getting for ssh that completion is incorrect. Arguments after the host name are executed on the remote host, so it is meaningless to complete them from local files and directories.

I beg to differ. The -i option is to reference the private key on the client side that you need to authenticate to the server. To complete against local files is proper.

@kovidgoyal
Copy link
Owner

You cannot specify arguments to ssh after the hostname.

man ssh

is your friend.

Use kssh -i whatever

and it will work fine. And I suggest you go open a bug report against
whoever maintains the completions for whatever shell you are using.

@grimm26
Copy link
Contributor Author

grimm26 commented Jul 28, 2022

mnk-hpbook in ~ on  (oh) 
12:05:28 ❯ ssh 192.168.15.6 -i ~/.ssh/id_rsa -o Port=23 uname -m
ssh: connect to host 192.168.15.6 port 23: Connection refused

mnk-hpbook in ~ on  (oh) 
12:05:30 ✖255 ❯ ssh 192.168.15.6 -i ~/.ssh/id_rsa uname -m           
x86_64

@grimm26
Copy link
Contributor Author

grimm26 commented Jul 28, 2022

and my completions work fine for ssh, but not for kssh. Hence me opening the issue here.

@kovidgoyal
Copy link
Owner

Then report the bug to ssh since the way it parses its command line is
in contravention to its own documentation.

ssh -h
usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface]
[-b bind_address] [-c cipher_spec] [-D [bind_address:]port]
[-E log_file] [-e escape_char] [-F configfile] [-I pkcs11]
[-i identity_file] [-J [user@]host[:port]] [-L address]
[-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
[-Q query_option] [-R address] [-S ctl_path] [-W host:port]
[-w local_tun[:remote_tun]] destination [command [argument ...]]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants