fix: specify --header-command when running coder start#526
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the way header command arguments are handled when running the "coder start" command so that the necessary "--header-command" argument is always provided. Key changes include:
- Adding a new helper function escapeCommandArg in util.ts for escaping command arguments.
- Replacing getHeaderCommand with getHeaderArgs in remote.ts and updating the command formation.
- Adjusting headers.ts and api.ts to support the new header arguments generation and propagation.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/util.ts | Added escapeCommandArg for safely escaping command arguments. |
| src/remote.ts | Updated header argument handling to use getHeaderArgs. |
| src/headers.ts | Introduced getHeaderArgs to generate escaped header arguments. |
| src/api.ts | Spread header arguments into the arguments list for coder start. |
bcpeinhardt
approved these changes
Jun 3, 2025
Contributor
|
@aslilac would you mind adding a note to the changelog as well? |
bcpeinhardt
reviewed
Jun 3, 2025
CHANGELOG.md
Outdated
| - Multiple open instances of the extension could potentially clobber writes to | ||
| `~/.ssh/config`. Updates to this file are now atomic. | ||
| - Add support for `anysphere.remote-ssh` Remote SSH extension. | ||
| - Use `--header-command` properly when starting a workspace. |
Contributor
There was a problem hiding this comment.
I think you meant to put this in the unreleased section!
Member
Author
There was a problem hiding this comment.
it's dark and scary in here, I got lost 😭
Member
Author
|
gonna wait to merge this until tomorrow. we're talking with the customer this is for and gonna try to do some testing. |
aslilac
added a commit
that referenced
this pull request
Jun 5, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #499
The
coder startcommand can't always work properly without specifying these args (eg., getting past proxies). This refactors the code a little to make it easier to get the right argument values, and passes them tocoder start.