wez / wezterm

A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust
https://wezfurlong.org/wezterm/
Other
18.19k stars 813 forks source link

Doesn't ignore non-implemented ssh config sections #5755

Open Lenbok opened 5 months ago

Lenbok commented 5 months ago

What Operating System(s) are you seeing this problem on?

Linux X11

Which Wayland compositor or X11 Window manager(s) are you using?

xfce

WezTerm version

wezterm 20240624-065522-552bb1d6

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

My ssh config uses Match Exec for dynamic behaviour on multiple machines, e.g:

Match exec "onsubnet --not 10.0.230." host office
     HostName office.somewhere.com
     ControlMaster auto
     Port 2222

So that hosts settings later in the file can automatically determine whether they can directly ssh to "office" vs needing to enable additional options.

Wezterm issues a warning when parsing the config WARN wezterm_ssh::config > Match Exec is not implemented, which is fine.

However, when I try to ssh to any host, it acts as though the settings (HostName, Port) in that section are active, basically breaking the ability to ssh to any host.

If wezterm doesn't support Match Exec, it would be much better to skip any settings covered by that statement (i.e. up until the next Match or Host declaration, as described in the "Host" and "Match" sections of man ssh_config).

To Reproduce

No response

Configuration

no config

Expected Behavior

I should still be able to ssh to hosts declared in my .ssh/config that do not depend on the ability to support Match Exec.

Logs

No response

Anything else?

No response

wez commented 4 months ago

It is ignoring the bit it doesn't understand; the following lines are interpreted as though the offending line was not present.

There are 3 options for how to handle this:

Lenbok commented 4 months ago

Option 4 would be to ignore the settings covered by the offending line (i.e. up until the next Host or Match line). Option 5 would be to permit the user to specify an alternative config so they can work around the partial support.