Improve support for running in Codespaces #945
Labels
enhancement
New feature or request
integration
Related to integration with another tool, IDE or environment
Milestone
Feature description
GCM sort of works if run in Codespaces (with Azure DevOps). First off, it uses
devicecode
flow. This works fine if you use git from the VS Code Terminal. Once you do this, as long as you have some kind of caching enabled, the VS Code GUI will also work.If you start in the VS Code GUI then it does not work. GCM sends the device code information to
/dev/tty
but VS Code is not trying to capture this or show it to the user so it is not possible to see the output. I modified the GCM code to output tostderr
instead and this almost works. This output does get captured by VS Code and displayed in their Git Output window. However, it does not output anything until the command fails. I glanced at the VS Code source code and it seems like it always runs Git operations in a try/catch so while it does capture stderr it does not look at the output until the operation completes.Shifting gears, I tried another approach. In GCM, I added a quick hack to also write
dcr.Message
to a text file in$HOME/.somedir
. I then used a VS Code extension to monitor this folder and when the text file arrives it displays the information to the user ins VS Code. I think a better option would be to serialize the entire dcr object to JSON so that the receiver would have more flexibility in how it displays the URL and Code to the user.What I am asking for? Could be one of a number of approaches:
stderr
instead of/dev/tty
. Maybe there is at least a way to recognize if nothing is attached totty
and then usestderr
? It is unclear if VS Code will ever handle any of this better but this would at least give it a chance. Usingstderr
seemed to work fine.The text was updated successfully, but these errors were encountered: