From 17cb6346a5c7fee0b14eebcd8174595c9e67d4d0 Mon Sep 17 00:00:00 2001 From: Jason Lunz Date: Wed, 23 Mar 2022 16:54:30 -0600 Subject: [PATCH] ssh.go: use setup example that should work with any ssh config The `gh cs ssh` command suggests an example recipe for setting up openssh integration. The last step appends an `Include` statement to the user's `~/.ssh/config`. Unfortunately, this won't always work as intended. If the existing configuration ends with a `Host` block, the added `Include` statement will be conditional on whether that block matches. By preceding the `Include` statement with `Match all`, we can ensure that it is always evaluated. --- pkg/cmd/codespace/ssh.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cmd/codespace/ssh.go b/pkg/cmd/codespace/ssh.go index 69c9c9ee1..52694551f 100644 --- a/pkg/cmd/codespace/ssh.go +++ b/pkg/cmd/codespace/ssh.go @@ -59,7 +59,7 @@ func newSSHCmd(app *App) *cobra.Command { $ gh codespace ssh $ gh codespace ssh --config > ~/.ssh/codespaces - $ echo 'include ~/.ssh/codespaces' >> ~/.ssh/config + $ printf 'Match all\nInclude ~/.ssh/codespaces\n' >> ~/.ssh/config `), PreRunE: func(c *cobra.Command, args []string) error { if opts.stdio {