[PR #2032] [CLOSED] WIP: Expose current TextAttributes from the underlying console API. #24776

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/2032
Author: @jazzdelightsme
Created: 7/19/2019
Status: Closed

Base: masterHead: user/danthom/wip/exposeCurrentTextAttribute


📝 Commits (1)

  • 14e3bc4 WIP: Expose current TextAttributes from the underlying console API.

📊 Changes

7 files changed (+46 additions, -15 deletions)

View changed files

📝 src/host/getset.cpp (+7 -1)
📝 src/host/getset.h (+4 -2)
📝 src/host/outputStream.cpp (+14 -2)
📝 src/host/outputStream.hpp (+2 -1)
📝 src/terminal/adapter/adaptDispatchGraphics.cpp (+1 -1)
📝 src/terminal/adapter/conGetSet.hpp (+3 -1)
📝 src/terminal/adapter/ut_adapter/adapterTest.cpp (+15 -7)

📄 Description

Summary of the Pull Request

This is not a polished PR that is ready to merge; it demonstrates a
direction for which I need to get buy-off from the team before pursuing
further.

I'm currently working on implementing the XTPUSHSGR/XTPOPSGR control
sequences (WIP PR here, which requires saving a [stack of] text
attributes, and not just the legacy attributes, but full RGB colors,
etc.

My first instinct was to implement the "business logic" (the stack) in
the AdaptDispatch layer, but that will require getting the [full] text
attributes from the underlying console API. This is not a terribly
"invasive" change, but it is exposing new stuff at a layer boundary.

Put another way, this means pound-including the
"../buffer/out/TextAttribute.hpp" header in a few places outside of
"buffer/out", and is that okay, or does that header need to be kept
private and isolated?

So there are a few ways this could go:

  1. You folks might say "ugh, no!", and:
    1. I could push (haha) the business logic of pushing and popping text
      attributes down another layer (so AdaptDispatch just forwards on
      the PushGraphicsRendition call to the lower layer, OR
    2. You suggest a different, cleaner way of exposing the text
      attributes.

OR

  1. Maybe you think this general direction is fine, but maybe you have
    some particular requests that I do certain things differently (I
    totally understand being picky about stuff that cuts across API
    layers).

What do you think?

References

Related: PR #1978
Related: Issue #1796

PR Checklist

  • Closes #xxx
  • CLA signed. If not, go over here and sign the CLA
  • Tests added/passed
  • Requires documentation to be updated
  • I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

none


🔄 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/2032 **Author:** [@jazzdelightsme](https://github.com/jazzdelightsme) **Created:** 7/19/2019 **Status:** ❌ Closed **Base:** `master` ← **Head:** `user/danthom/wip/exposeCurrentTextAttribute` --- ### 📝 Commits (1) - [`14e3bc4`](https://github.com/microsoft/terminal/commit/14e3bc4339e4f589ce67b92407cc26b293479fc9) WIP: Expose current TextAttributes from the underlying console API. ### 📊 Changes **7 files changed** (+46 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `src/host/getset.cpp` (+7 -1) 📝 `src/host/getset.h` (+4 -2) 📝 `src/host/outputStream.cpp` (+14 -2) 📝 `src/host/outputStream.hpp` (+2 -1) 📝 `src/terminal/adapter/adaptDispatchGraphics.cpp` (+1 -1) 📝 `src/terminal/adapter/conGetSet.hpp` (+3 -1) 📝 `src/terminal/adapter/ut_adapter/adapterTest.cpp` (+15 -7) </details> ### 📄 Description <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request This is not a polished PR that is ready to merge; it demonstrates a direction for which I need to get buy-off from the team before pursuing further. I'm currently working on implementing the XTPUSHSGR/XTPOPSGR control sequences (WIP PR [here](https://github.com/microsoft/terminal/pull/1978), which requires saving a [stack of] text attributes, and not just the legacy attributes, but full RGB colors, etc. My first instinct was to implement the "business logic" (the stack) in the `AdaptDispatch` layer, but that will require getting the [full] text attributes from the underlying console API. This is not a *terribly* "invasive" change, but it is exposing new stuff at a layer boundary. Put another way, this means pound-including the "../buffer/out/TextAttribute.hpp" header in a few places outside of "buffer/out", and is that okay, or does that header need to be kept private and isolated? So there are a few ways this could go: 1. You folks might say "ugh, no!", and: 1. I could push (haha) the business logic of pushing and popping text attributes down another layer (so `AdaptDispatch` just forwards on the [PushGraphicsRendition](https://github.com/microsoft/terminal/blob/0af275b9cb68da14f38f05b2cdcbb35da99cb17c/src/terminal/adapter/adaptDispatchGraphics.cpp#L452) call to the lower layer, OR 2. You suggest a different, cleaner way of exposing the text attributes. OR 2. Maybe you think this general direction is fine, but maybe you have some particular requests that I do certain things differently (I totally understand being picky about stuff that cuts across API layers). What do you think? <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> ## References Related: PR #1978 Related: Issue #1796 <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [ ] Closes #xxx * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [ ] Requires documentation to be updated * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed *none* --- <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:05:17 +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#24776