Repository navigation
Conversation
Using `code-server --wait --reuse-window` as GIT_EDITOR fails with "Unknown option --wait" whenever code-server's own script is the one on PATH rather than the remote-cli script VS Code adds to the integrated terminal (coder#8089). It also cannot be used as an editor from a shell outside the integrated terminal. With --wait, code-server now creates a marker file, passes it to Code with the open request, and returns once Code deletes it, which Code does when the opened files are closed. This is what VS Code's remote-cli does. Like --reuse-window, --wait always opens in an existing instance.
This branch has not been deployed
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.
Fixes #8089
As suggested in the issue, this adds
--waitto code-server's own script, socode-server --wait --reuse-windowworks asGIT_EDITOReven when that script is the one onPATHinstead ofremote-cli. It also works from a shell outside the integrated terminal, through the session socket.It does what VS Code's remote-cli does: create a marker file, send it as
waitMarkerFilePathwith the open request, and return once Code deletes it after the files are closed. Like--reuse-window,--waitonly opens in an existing instance and errors if there is none.-wis already--welcome-text, so there's no short flag.Added unit tests for the wait loop (with a fake socket standing in for Code's) and for
--waitnot falling back to starting a server. I haven't run it against a full build.