Skip to content

--wait command-line option #2110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bsiegert opened this issue Sep 18, 2020 · 13 comments · Fixed by #5360
Closed

--wait command-line option #2110

bsiegert opened this issue Sep 18, 2020 · 13 comments · Fixed by #5360
Labels
feature New user visible feature
Milestone

Comments

@bsiegert
Copy link

If you are working in the terminal, the suggested way of using VS Code itself as your editor for commit messages and such is to set

export EDITOR="code --wait"

This does not work within code-server obviously. You can set EDITOR to code-server but it does not have a --wait option, so git (or whatever) will not wait for you to close the window.

The --wait option, together with one or more files, should make the code-server binary only exit when these files are closed.

@nhooyr nhooyr added enhancement Some improvement that isn't a feature feature New user visible feature and removed feature enhancement Some improvement that isn't a feature labels Dec 7, 2020
@jsjoeio jsjoeio added this to the Backlog milestone Apr 29, 2021
@stale
Copy link

stale bot commented Oct 27, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no activity occurs in the next 5 days.

@stale stale bot added the stale label Oct 27, 2021
@bsiegert
Copy link
Author

This is a legitimate feature request, please don't close it.

@stale stale bot removed the stale label Oct 27, 2021
@stale
Copy link

stale bot commented Apr 25, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no activity occurs in the next 5 days.

@stale stale bot added the stale label Apr 25, 2022
@bsiegert
Copy link
Author

Repeating myself: please do not close this legitimate feature request.

@stale stale bot removed the stale label Apr 26, 2022
@jsjoeio
Copy link
Contributor

jsjoeio commented Apr 26, 2022

Is this something that vanilla VS Code supports already?

@bsiegert
Copy link
Author

Yes, it does, with code --wait.

@jsjoeio
Copy link
Contributor

jsjoeio commented Apr 26, 2022

Interesting! Well if that's the case, I wonder if we could just pass it through and it would just work 🤔

How does this work in practice?

  1. change EDITOR
  2. git add . stage changes
  3. git commit start commit

Then it opens VS Code, you edit message, then it exits VS Code?

Understanding how this works in practice would help us find time to investigate this faster.

@JKrag
Copy link

JKrag commented Apr 27, 2022

Vscode has the '--wait' option exactly like Sublime and Atom before it. (Notepad++ and most other multi-tab editors have a similar but differently named switch).
They basically tell the editor to open the specified file in a separate thread and that there is a process waiting for that thread to exit.

In git you typically configure your editor with:
'git config --global core.editor "code --wait"'
So every time git tries to edit the "hidden" COMMIT_MESSAGE file it does that with the '--wait' switch.

It would be very useful to have the same feature available in the server version of VSCode.

@jsjoeio
Copy link
Contributor

jsjoeio commented Apr 27, 2022

Ah okay, thank you @JKrag! If it's supported in VS Code, then it does seem like something we should be able to support in code-server without too much work. But that's me guessing. We'd have to investigate as well.

@jsjoeio jsjoeio modified the milestones: Backlog, On Deck Apr 27, 2022
@JKrag
Copy link

JKrag commented Apr 28, 2022

I guess the question might be whether it is "ok" for code-server to be spawning new processes on the host it is running on. I don't know if this is a challenge or security risk or anything, but the the thought did come to mind.

@felipecrs
Copy link

felipecrs commented Jul 19, 2022

Not only VS Code supports it, but also their "remote" implementation (i.e. Codespaces/Containers) and even Gitpod's OpenVSCode Server.

In my opinion, this is a huge feature which is missing in the code-server CLI, which essentially makes me unable to use code-server's VS Code to edit git commit messages, or to edit anything else which is spawned on the command line.

@jsjoeio
Copy link
Contributor

jsjoeio commented Jul 20, 2022

@code-asher how difficult would this be to implement?

Thinking out loud:

  1. add CLI flag
  2. when passed, open code-server with git commit message
  3. when commit message is finished and file is closed, close code-server and stop process

Screenshots

image

image

@code-asher
Copy link
Member

code-asher commented Jul 21, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New user visible feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants