Add support for Azure Cloud Shell code Editor #7789

Open
opened 2026-01-31 01:12:44 +00:00 by claunia · 6 comments
Owner

Originally created by @micgruber on GitHub (Apr 29, 2020).

Environment

Windows build number: Windows 10 Version 1909 Build 18363.657
Windows Terminal version: 0.11.1121.0

Steps to reproduce

  1. Open the Windows Terminal
  2. Open Azure Cloud Shell
  3. Login to Azure
  4. Type code . or code file.txt

Expected behavior

The azure cloud shell editor should open in the background with the provided file like explained here: https://docs.microsoft.com/en-us/azure/cloud-shell/using-cloud-shell-editor.

Actual behavior

Nothing happens no editor will be opened.

Originally created by @micgruber on GitHub (Apr 29, 2020). # Environment ```none Windows build number: Windows 10 Version 1909 Build 18363.657 Windows Terminal version: 0.11.1121.0 ``` # Steps to reproduce 1. Open the Windows Terminal 2. Open Azure Cloud Shell 3. Login to Azure 4. Type code . or code file.txt # Expected behavior The azure cloud shell editor should open in the background with the provided file like explained here: https://docs.microsoft.com/en-us/azure/cloud-shell/using-cloud-shell-editor. # Actual behavior Nothing happens no editor will be opened.
claunia added the Issue-FeatureProduct-TerminalArea-ExtensibilityArea-AzureShell labels 2026-01-31 01:12:44 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Apr 29, 2020):

Huh, there was another thread on this repo months ago about this but the user never actually provided any more info about what code . was supposed to do. TIL about the code thing, thanks, that's pretty cool actually!

I'm very curious how that actually works in the browser. It's certainly easy enough for them to embed a JS text editor somewhere in the html of the webpage, but that would be a little trickier for us.

I'll tag this up as a potential extension idea in the future, since this correlates strongly with a lot of the work we're doing there.

@zadjii-msft commented on GitHub (Apr 29, 2020): Huh, there was another thread on this repo months ago about this but the user never actually provided any more info about what `code .` was supposed to do. TIL about the `code` thing, thanks, that's pretty cool actually! I'm _very_ curious how that actually works in the browser. It's certainly easy enough for them to embed a JS text editor somewhere in the html of the webpage, but that would be a little trickier for us. I'll tag this up as a potential extension idea in the future, since this correlates strongly with a lot of the work we're doing there.
Author
Owner

@micgruber commented on GitHub (Apr 29, 2020):

Hi,

thanks for the quick reply. Is it also possible as a workaround to use visual studio code within the azure cloud shell and launch the file in windows visual studio code like with the ubuntu wsl?

@micgruber commented on GitHub (Apr 29, 2020): Hi, thanks for the quick reply. Is it also possible as a workaround to use visual studio code within the azure cloud shell and launch the file in windows visual studio code like with the ubuntu wsl?
Author
Owner

@DHowett-MSFT commented on GitHub (Apr 30, 2020):

Unfortunately, this might be something we just can't do. It only works on the web because Code can be embedded in the webapp. Hmm.

@DHowett-MSFT commented on GitHub (Apr 30, 2020): Unfortunately, this might be something we just can't do. It only works on the web because Code can be embedded in the webapp. Hmm.
Author
Owner

@GraemeMeyerGT commented on GitHub (Jan 19, 2023):

Could you include an error message explaining that the feature isn't available? Right now if you run code in Az Cloud Shell it just fails silently. Not sure if that would be a WT issue or an AzCS issue. As another commenter suggested, reditrecting/referring to VSCode seems like a good work-around

@GraemeMeyerGT commented on GitHub (Jan 19, 2023): Could you include an error message explaining that the feature isn't available? Right now if you run `code` in Az Cloud Shell it just fails silently. Not sure if that would be a WT issue or an AzCS issue. As another commenter suggested, reditrecting/referring to VSCode seems like a good work-around
Author
Owner

@zadjii-msft commented on GitHub (Jan 19, 2023):

Could you include an error message explaining that the feature isn't available

I'm not sure that's something we could control. That'd have to be a feature of the Cloud Shell itself I'm afraid.

@zadjii-msft commented on GitHub (Jan 19, 2023): > Could you include an error message explaining that the feature isn't available I'm not sure that's something we could control. That'd have to be a feature of the Cloud Shell itself I'm afraid.
Author
Owner

@richeney commented on GitHub (Apr 3, 2023):

Are Code Tunnels an option here?

On an Ubuntu VM I can run the following:

wget https://code.visualstudio.com/sha/download?build=stable\&os=cli-alpine-x64 -O /tmp/code.tar.gz
sudo tar -zxvf /tmp/code.tar.gz -C /usr/local/bin && rm /tmp/code.tar.gz
code tunnel --name $(hostname) --accept-server-license-terms

And awesome things happen. (Code Tunnels are so good.)

I tried the following on Cloud Shell in Windows Terminal:

wget https://code.visualstudio.com/sha/download?build=stable\&os=cli-alpine-x64 -O /tmp/code.tar.gz
[[ ! -d ~/.local/bin ]] && mkdir -pm 755 ~/.local/bin
tar -zxvf /tmp/code.tar.gz -C ~/.local/bin && rm /tmp/code.tar.gz
mv ~/.local/bin/code ~/.local/bin/vscode
vscode tunnel --name $(hostname | cut -c1-20) --accept-server-license-terms --no-sleep

And it does the OAuth part, but then gets stuck in an API storm of some type, looping with this error: "This application has made an unusually high number of requests to access your account. Please reauthorize the application to continue."

@richeney commented on GitHub (Apr 3, 2023): Are Code Tunnels an option here? On an Ubuntu VM I can run the following: ```bash wget https://code.visualstudio.com/sha/download?build=stable\&os=cli-alpine-x64 -O /tmp/code.tar.gz sudo tar -zxvf /tmp/code.tar.gz -C /usr/local/bin && rm /tmp/code.tar.gz code tunnel --name $(hostname) --accept-server-license-terms ``` And awesome things happen. (Code Tunnels are so good.) I tried the following on Cloud Shell in Windows Terminal: ```bash wget https://code.visualstudio.com/sha/download?build=stable\&os=cli-alpine-x64 -O /tmp/code.tar.gz [[ ! -d ~/.local/bin ]] && mkdir -pm 755 ~/.local/bin tar -zxvf /tmp/code.tar.gz -C ~/.local/bin && rm /tmp/code.tar.gz mv ~/.local/bin/code ~/.local/bin/vscode vscode tunnel --name $(hostname | cut -c1-20) --accept-server-license-terms --no-sleep ``` And it does the OAuth part, but then gets stuck in an API storm of some type, looping with this error: "This application has made an unusually high number of requests to access your account. Please reauthorize the application to continue."
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#7789