Skip to content

UX improvement for CLI prompt on MS Learn #52

@videlalvaro

Description

@videlalvaro

To Reproduce

Open a Learn module on MS Learn, like unit 5 here https://docs.microsoft.com/en-us/learn/modules/implement-message-workflows-with-service-bus/5-exercise-write-code-that-uses-service-bus-queues and then launch the cloud shell in the browser, in the same tab.

Observed Behavior

The problem is that the prompt is too long and takes the whole screen width, since it's displaying the whole PWD instead of just the current folder.

cloud_shell_prompt_better_PS1_2

Expected behavior

Have a shorter CLI prompt.

We could modify the PS1 variable in .bashrc when we see the modifier \w that displays the full path, we could have \W instead (uppercase W. see screenshot for the difference).

Context

Cloud Shell on Learn seems to use a .bashrc file similar to this one https://github.com/ams0/azure-cloudshell/blob/master/bashrc#L121 since there's that Azure modifier to PS1, but I couldn't find where that sits on this repo.

A quick solution could be during container boot, to have the docker file cat a PS1=${PS1//\\w/\\W} into $HOME/.bashrc

Tagging @johnpapa to the discussion, since he's on board for the change for Learn.

Metadata

Metadata

Labels

Area-imageChanges to the base/tools imageIteration-BacklogCloud Shell team will address this in the futureMS LearnIssues related to Cloud Shell in MS LearnStatus-In_reviewItem under consideration by the Cloud Shell teambugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions