[PR #4756] [MERGED] AzCon: improve input, usability, reliability (4 commits) #25934

Open
opened 2026-01-31 09:12:47 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/4756
Author: @DHowett-MSFT
Created: 2/29/2020
Status: ✅ Merged
Merged: 3/4/2020
Merged by: @DHowett-MSFT

Base: master ← Head: dev/duhowett/azure_2


📝 Commits (4)

  • f331572 Azure: rewrite user input handler
  • 3a96cda Azure: display the user's options and additional information in color
  • 8eaeff4 Azure: follow the user's shell choice from the online portal
  • daf32ee Azure: remove all credentials instead of just the first one

📊 Changes

3 files changed (+234 additions, -191 deletions)

View changed files

📝 src/cascadia/TerminalConnection/AzureConnection.cpp (+206 -166)
📝 src/cascadia/TerminalConnection/AzureConnection.h (+15 -12)
📝 src/cascadia/TerminalConnection/Resources/Resources.language-en.resw (+13 -13)

📄 Description

This pull request comprises four commits that improve the Azure connection.

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.

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  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

just a silly bug.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/4756 **Author:** [@DHowett-MSFT](https://github.com/DHowett-MSFT) **Created:** 2/29/2020 **Status:** ✅ Merged **Merged:** 3/4/2020 **Merged by:** [@DHowett-MSFT](https://github.com/DHowett-MSFT) **Base:** `master` ← **Head:** `dev/duhowett/azure_2` --- ### 📝 Commits (4) - [`f331572`](https://github.com/microsoft/terminal/commit/f331572d7dd6942ed84f828c02dec821f88e6714) Azure: rewrite user input handler - [`3a96cda`](https://github.com/microsoft/terminal/commit/3a96cda8196049aded273d2ba32ac6686a0ac48a) Azure: display the user's options and additional information in color - [`8eaeff4`](https://github.com/microsoft/terminal/commit/8eaeff4b6aa11591f8832e3d3b3e787b55ff0e4f) Azure: follow the user's shell choice from the online portal - [`daf32ee`](https://github.com/microsoft/terminal/commit/daf32ee185126064bbef2d4b0ab41a67087a9897) Azure: remove all credentials instead of just the first one ### 📊 Changes **3 files changed** (+234 additions, -191 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalConnection/AzureConnection.cpp` (+206 -166) 📝 `src/cascadia/TerminalConnection/AzureConnection.h` (+15 -12) 📝 `src/cascadia/TerminalConnection/Resources/Resources.language-en.resw` (+13 -13) </details> ### 📄 Description This pull request comprises four commits that improve the Azure connection. ## 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 &amp;#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 just a silly bug. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:12:47 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#25934