Expand SSH hostname to IP where necessary (telnet for example)
- Dominant language
- Go
- Stars
- 83.1k
- Forks
- 3.1k
- Avg merge
- 17h 8m
- Merged PRs (30d)
- 10
Description
- [x] I have read through the manual page (`man fzf`)
- [x] I have the latest version of fzf
- [x] I have searched through the existing issues
## Info
- OS
- [x] Linux
- [ ] Mac OS X
- [ ] Windows
- [ ] Etc.
- Shell
- [x] bash
- [x] zsh
- [x] fish
## Problem / Steps to reproduce
SSH hosts configuration file ~/.ssh/config is parsed when the fzf "host" completion is used. The configured names of hosts and their respective addresses (IP/domain) are parsed into two separate fuzzy completion hits. However, the configured names cannot be used with non-SSH commands as they do not use the SSH config file (telnet being an example) and so these fuzzy completion hits are not useful. It would be a practical feature if in these cases fzf expanded SSH names into addresses (after selecting the name from the list of hits).
Such a solution could be implemented with a new "host_sshexpand" completion mode, but if this is not desired, the existing "host" one could be refit for this purpose and provide the described expansion by default. And then the SSH-type commands (ssh, scp, dbclient, ...) could be treated as special cases where this additional expansion is not necessary.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing fzf's host completion entry point and how it parses ~/.ssh/config. Compare the selected-host behavior for telnet with SSH-type commands such as ssh, scp, and dbclient. Done means non-SSH commands receive the configured address while SSH commands retain their existing host behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bash, fish, go, zsh
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100