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

Feature Request: Azure Cloud Shell option to select PowerShell instead of bash #2266

Closed
AlanMcBee opened this issue Aug 5, 2019 · 3 comments · Fixed by #4756
Closed

Feature Request: Azure Cloud Shell option to select PowerShell instead of bash #2266

AlanMcBee opened this issue Aug 5, 2019 · 3 comments · Fixed by #4756
Labels
Area-AzureShell Workitems pertaining to the Azure Cloud Shell connection. Issue-Task It's a feature request, but it doesn't really need a major design. Needs-Tag-Fix Doesn't match tag requirements Priority-3 A description (P3) Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Milestone

Comments

@AlanMcBee
Copy link

AlanMcBee commented Aug 5, 2019

Description of the new feature/enhancement

Connecting to Azure Cloud Shell using Terminal 0.3 will automatically launch the bash cloud shell provider. Personally, I prefer PowerShell.

I am able to launch PowerShell from bash by using pwsh, but there is a bug: when running PowerShell Core (launched from bash) using the Azure Cloud Shell, the cursor position gets repositioned to 0,0 on every new command, and the output is overlaid on the previous output (gets very messy, hard to read).

While it is probably a good idea to address that bug, this request is just to add or modify a profile to support PowerShell Core. (I'm going to create a new issue for that bug and update this.)
UPDATED: Here is the bug report: #2267

Proposed technical implementation details (optional)

I thought it could just be possible to have Terminal go directly to PowerShell (preferably PowerShell Core) as an option for the Azure Cloud Shell profile settings, or else as a whole new profile.

As one of the profiles listed for a new tab in Terminal, I'd be okay with just one Azure Cloud Shell profile, where I would need to modify the settings.json to configure that profile to select the PowerShell Core option instead of the default bash option, or else there could be two Azure Cloud Shell profiles, one for bash and one for PowerShell Core.

@AlanMcBee AlanMcBee added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Aug 5, 2019
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Aug 5, 2019
@DHowett-MSFT DHowett-MSFT added Area-AzureShell Workitems pertaining to the Azure Cloud Shell connection. Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Aug 5, 2019
@DHowett-MSFT DHowett-MSFT added this to the Terminal v1.0 milestone Aug 5, 2019
@bitcrazed
Copy link
Contributor

Currently blocked on #1883 as per comments here:

// Request for a terminal for said cloud shell
// We only support bash for now, so don't bother with the user's preferred shell
// fyi: we can't call powershell yet because it sends VT sequences we don't support yet
// TODO: GitHub #1883

@DHowett-MSFT DHowett-MSFT added the Mass-Chaos Temporary use to trigger the bot. label Oct 22, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Oct 22, 2019
@DHowett-MSFT DHowett-MSFT removed the Mass-Chaos Temporary use to trigger the bot. label Oct 22, 2019
@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label Oct 22, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Jan 23, 2020
@cinnamon-msft cinnamon-msft added Needs-Tag-Fix Doesn't match tag requirements Priority-3 A description (P3) v1-Scrubbed labels Jan 23, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Jan 23, 2020
DHowett-MSFT pushed a commit that referenced this issue Feb 20, 2020
This commit introduces a small console-subsystem application whose sole
job is to consume TerminalConnection.dll and hook it up to something
other than Terminal. It is 99% of the way to a generic solution.

I've introduced a stopgap in TerminalPage that makes sure we launch
TerminalAzBridge using ConptyConnection instead of AzureConnection.

As a bonus, this commit includes a class whose sole job it is to make
reading VT input off a console handle not terrible. It returns you a
string and dispatches window size change callbacks.

Fixes #2267.
Fixes #4589.
Related to #2266 (since pwsh needs better VT).
DHowett-MSFT pushed a commit that referenced this issue Feb 21, 2020
This commit introduces a small console-subsystem application whose sole
job is to consume TerminalConnection.dll and hook it up to something
other than Terminal. It is 99% of the way to a generic solution.

I've introduced a stopgap in TerminalPage that makes sure we launch
TerminalAzBridge using ConptyConnection instead of AzureConnection.

As a bonus, this commit includes a class whose sole job it is to make
reading VT input off a console handle not terrible. It returns you a
string and dispatches window size change callbacks.

Fixes #2267.
Fixes #4589.
Related to #2266 (since pwsh needs better VT).
@Ayanmullick
Copy link

Ayanmullick commented Feb 27, 2020

I tried to run PowerShell from bash and it fails.

image

@DHowett-MSFT
Copy link
Contributor

@Ayanmullick Lucky you! You hit a bug that I just filed upstream on PowerShell: PowerShell/PSReadLine#1376

@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label Mar 4, 2020
DHowett-MSFT pushed a commit that referenced this issue Mar 4, 2020
* Azure: rewrite user input handler

This commit replaces the AzureConnection's input handler with one that
acts more like "getline()". Instead of the Read thread setting a state
and WriteInput filling in the right member variable, the reader blocks
on the user's input and receives it in an optional<string>.

This moves the input number parsing and error case handling closer to
the point where those inputs are used, as opposed to where they're
collected.

It also switches our input to be "line-based", which is a huge boon for
typing tenant numbers >9. This fixes #3233. A simple line editor
(supporting only backspace and CR) is included.

It also enables echo on user input, and prints it in a nice pretty green
color.

It also enables input queueing: if the user types anything before the
connection is established, it'll be sent once it is.

Fixes #3233.

* Azure: display the user's options and additional information in color

This commit colorizes parts of the AzCon's strings that include "user
options" -- things the user can type -- in yellow. This is to help with
accessibility.

The implementation here is based on a discussion with the team.
Alternative options for coloration were investigated, such as:

* Embedding escape sequences in the resource file.
  This would have been confusing for translators.
  The RESW file format doesn't support &#x1B; escapes, so we would need
  some magic post-processing.
* Embedding "markup" in the resource file (like #{93m}, ...)
  This still would have been annoying for translators.

We settled on an implementation that takes resource names, colorizes
them, and string-formats them into other resources.

* Azure: follow the user's shell choice from the online portal

Fixes #2266.

* Azure: remove all credentials instead of just the first one
@ghost ghost added Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed In-PR This issue has a related PR labels Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-AzureShell Workitems pertaining to the Azure Cloud Shell connection. Issue-Task It's a feature request, but it doesn't really need a major design. Needs-Tag-Fix Doesn't match tag requirements Priority-3 A description (P3) Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants