quantumsheep / sshs

Terminal user interface for SSH
MIT License
612 stars 17 forks source link

Unable to launch after splitting ssh config file #55

Closed BhaveshDiwan closed 4 months ago

BhaveshDiwan commented 11 months ago

sshs was running fine with my initial ssh configuration which looked like this:

Host personal
    Hostname personal.com
    .... other config elements....

Host work
    Hostname work.com
    .... other config elements....

VisualHostKey yes
.... other global flags...

For better management, I split my config into multiple files:

Now sshs will fail with error 2023/07/30 02:40:24 /Users/Laptop/.ssh/config:209: config variable before Host variable

and this issue is happening because of anything at place of .... other global flags... regardless of where they exist in config file, in separate file, or order of imports.

Additional Information that might be helpful: https://github.com/mikkeloscar/sshconfig/blob/main/parser.go#L146 OS: Ventura 13.4.1 on Apple M1 Max. Shell: kitty 0.29.2 sshs version 3.4.0

userwiths commented 4 months ago

Hey, hello. This is really a strange interaction but the link you provided was helpful indeed.

If I may suggest, the config does not work if you have a general (non host) parameter without having a host. So I did some tests and I found that

Include personal/config
Include work/config

Host *
   User bypass

VisualHostKey yes

Works for me. That is if personal/config and work/config have only hosts or includes in them and no other arguments.

Hope this works for you.

quantumsheep commented 4 months ago

Hey! That should not be a problem anymore in 4.0.0

userwiths commented 4 months ago

4.0.1 look good for me with

Include first.conf
Include second.conf

VisualHostKey yes

Also congrats on the rewrite :tada: .