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.
Since all of the port operations require the codespace to be running, we
need to disallow these operations when there's a pending op since we
can't start the codespace in this state.
Since the API already disallows this, this is basically cleaning up the
error messages that the user sees in this state
Old error message:
```
$ gh cs ports forward 80:80
? Choose codespace: redacted
Starting codespace â£ğerror connecting to codespace: error starting codespace: HTTP 422: your codespace has an operation pending: updating to a sku with a different amount of storage; please wait until this operation is complete (https://api.github.com/user/codespaces/cwndrws-redacted/start)
```
New error message:
```
$ gh cs ports forward 80:80
? Choose codespace: redacted
codespace is disabled while it has a pending operation: Changing machine types...
exit status 1
```
The initial intention for this change was to disallow users to open a
codespace in VS Code if the codespace has a pending operation. This also
adds a side-benefit of presenting the user an error before waiting for
VS Code to open if they provide an invalid codespace to open.
Since the API already disallows this, this pretty much just cleans up
the error reporting to the user.
Example of old error:
```
$ gh cs logs -c cwndrws-redacted
Starting codespace ⣽connecting to codespace: error starting codespace: HTTP 422: your codespace has an operation pending: updating to a sku with a different amount of storage; please wait until this operation is complete (https://api.github.com/user/codespaces/cwndrws-redacted/start)
exit status 1
```
Example of new error:
```
$ gh cs logs -c cwndrws-redacted
codespace is disabled while it has a pending operation: Changing machine types...
exit status 1
```
Since the API already disallows this, this makes the error cleaner and
more explicit when a user is trying to start/ssh into a codespace that
has a pending operation.
Example of the old error message:
```
$ gh cs ssh -c cwndrws-redacted
Starting codespace ⣽error connecting to codespace: error starting codespace: HTTP 422: your codespace has an operation pending: updating to a sku with a different amount of storage; please wait until this operation is complete (https://api.github.com/user/codespaces/cwndrws-redacted/start)
exit status 1
```
Example of the new error message:
```
$ gh cs ssh -c cwndrws-redacted
codespace is disabled while it has a pending operation: Changing machine types...
exit status 1
```