Skip to content
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

Does not wait for editor in some cases when doing a POST/PUT/etc #310

Closed
tlmii opened this issue Dec 6, 2019 · 6 comments · Fixed by #412
Closed

Does not wait for editor in some cases when doing a POST/PUT/etc #310

tlmii opened this issue Dec 6, 2019 · 6 comments · Fixed by #412
Labels
5.0-dash Potential final items for 5.0 bug Something isn't working
Milestone

Comments

@tlmii
Copy link
Member

tlmii commented Dec 6, 2019

HttpRepl version: 3.0.47301
VS Code version: 1.40.2
OS: Windows 10

If I have VS Code open, and VS Code is set to be the editor on the tool, the "template" file pops open in VS Code correctly, but the tab title for the file says "(deleted)" and the tool does not wait for the file to be closed, it just sends it right away and then deletes the file.

If I don't have VS Code open, and so it is launched when executing a POST, the process seems to work as expected.

@tlmii tlmii added the bug Something isn't working label Dec 6, 2019
@bradygaster
Copy link
Member

investigate for 3.1 - if possible mark it otherwise continue to watch for reports on this.

@vijayshinva
Copy link

image

I am facing a similar issue. The moment I type the post command and hit enter this error is displayed. The vscode window opens a second latter.

@tlmii
Copy link
Member Author

tlmii commented Jul 8, 2020

@vijayshinva

I think this might be a different bug, because in my case the file is still there on disk when the read occurs, I'm just not given the opportunity to modify it before it is read. It seems like in your case the file is deleted before it is read - or perhaps it is never actually created and written to. But it could be related, somehow.

Does this happen the same way whether or not you have VS Code already open when you execute the command?
Does the same thing occur if you set your editor to be notepad instead of vs code?

@tlmii
Copy link
Member Author

tlmii commented Aug 16, 2020

I'll need to do more digging on this to see if it is reasonable to pass this command ourselves or handle it more directly, but here's the workaround:

in addition to setting editor.command.default, also set editor.command.default.arguments to -w:

pref set editor.command.default.arguments "-w"

This will tell VS Code to wait for you to close the editor before returning, even if it is the case where it opens it in an existing window.

@tlmii
Copy link
Member Author

tlmii commented Oct 22, 2020

@bradygaster This is probably more of a question for you. It seems like we would always want someone who sets their editor to VS Code to also set the default arguments to add the -w switch.

Should we inspect what they set as their editor and suggest it via text on the screen? Should we automatically add it (if the args are otherwise empty when they set the editor)? Should we just put it in the documentation?

@tlmii tlmii added the 5.0-dash Potential final items for 5.0 label Oct 22, 2020
@bradygaster
Copy link
Member

This is probably more of a question for you. It seems like we would always want someone who sets their editor to VS Code to also set the default arguments to add the -w switch.

Yes and we could document that on the VS Code site or in an extension if need be.

Should we inspect what they set as their editor and suggest it via text on the screen?

That'd be ideal but I wouldn't block on other larger issues if this becomes a time vortex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.0-dash Potential final items for 5.0 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants