Created attachment 3546 [details] Add original hostname to output of "ssh -G" Hey! In some occasions, it is interesting to be able to extract the host provided as an argument. In my case, this is useful when wrapping the SSH command to update the window title with the hostname or add additional arguments depending on the target host. This can currently be done with `ssh -G` but the returned hostname is the `Hostname` option which may not match the hostname provided on the command-line. In my case, it is often an IP address which is not helpful to display as a window title. Would it be possible to add the original hostname to the output of `ssh -G`? Attached a tiny patch for this purpose.
The output of ssh -G is itself a valid ssh_config(5) and we have a test that checks that (which occasionally does pick up problems). Your change as is would break that, but outputting it as a Host line should work.
Created attachment 3547 [details] Move host_arg into config struct and add to -G output
Hey! As 8.8 is around the corner, am I expected to do something to make this move forward? I have tested the patch on master of openssh-portable and it works fine for me.
Just in case, running the patch on top of 8.8 portable, no issue on my side.
This has been committed and will be in the 9.2 release. Thanks for the report.
OpenSSH 9.3 has been released. Close resolved bugs