[PR #3566] [MERGED] Fix Reverse Walking in AttrRowIterator #25428

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/3566
Author: @carlos-zamora
Created: 11/13/2019
Status: Merged
Merged: 12/10/2019
Merged by: @carlos-zamora

Base: masterHead: dev/cazamor/bugfix-chunk-select


📝 Commits (6)

  • 2976559 Remove minor optimization in AttrRowIterator
  • 7a4ac30 Add test + update natvis
  • 16a854d Added _exceeded flag to AttrRowIterator and additional tests
  • b553ca7 fix comments
  • 2ada285 fix log comment for tests
  • a2cc1c2 better comments on testing. Fix test case.

📊 Changes

5 files changed (+167 additions, -18 deletions)

View changed files

📝 src/buffer/out/AttrRowIterator.cpp (+26 -10)
📝 src/buffer/out/AttrRowIterator.hpp (+1 -0)
📝 src/cascadia/TerminalCore/TerminalSelection.cpp (+2 -2)
📝 src/host/ut_host/AttrRowTests.cpp (+129 -0)
📝 tools/ConsoleTypes.natvis (+9 -6)

📄 Description

Summary of the Pull Request

The count -= _currentAttributeIndex caused _run to go out of bounds. Removing the minor optimization fixes this potential crash.

References

#3409

PR Checklist

Detailed Description of the Pull Request / Additional comments

@miniksa knows much more about this. He's the real MVP.

Validation Steps Performed

  1. Open ubuntu shell
  2. double click the : or ~ in cazamor@PC-cazamor:~$

This used to crash. Not anymore!


🔄 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/3566 **Author:** [@carlos-zamora](https://github.com/carlos-zamora) **Created:** 11/13/2019 **Status:** ✅ Merged **Merged:** 12/10/2019 **Merged by:** [@carlos-zamora](https://github.com/carlos-zamora) **Base:** `master` ← **Head:** `dev/cazamor/bugfix-chunk-select` --- ### 📝 Commits (6) - [`2976559`](https://github.com/microsoft/terminal/commit/2976559c170e461f665f07a23b673ffe1f28f15a) Remove minor optimization in AttrRowIterator - [`7a4ac30`](https://github.com/microsoft/terminal/commit/7a4ac30dd08d06353e15a51eda2d0cc87b561239) Add test + update natvis - [`16a854d`](https://github.com/microsoft/terminal/commit/16a854dbf9ac6e2e12a998ad7acfff38af798f8c) Added _exceeded flag to AttrRowIterator and additional tests - [`b553ca7`](https://github.com/microsoft/terminal/commit/b553ca702a735c96021f8815b09d93440f702e8b) fix comments - [`2ada285`](https://github.com/microsoft/terminal/commit/2ada28572830edaa3368a9d5bc444039b266be1b) fix log comment for tests - [`a2cc1c2`](https://github.com/microsoft/terminal/commit/a2cc1c25317c6dbb35fc8910fc13a8ca69b7d3e5) better comments on testing. Fix test case. ### 📊 Changes **5 files changed** (+167 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `src/buffer/out/AttrRowIterator.cpp` (+26 -10) 📝 `src/buffer/out/AttrRowIterator.hpp` (+1 -0) 📝 `src/cascadia/TerminalCore/TerminalSelection.cpp` (+2 -2) 📝 `src/host/ut_host/AttrRowTests.cpp` (+129 -0) 📝 `tools/ConsoleTypes.natvis` (+9 -6) </details> ### 📄 Description ## Summary of the Pull Request The `count -= _currentAttributeIndex` caused `_run` to go out of bounds. Removing the minor optimization fixes this potential crash. ## References #3409 <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Closes #3409 * [x] CLA signed * [ ] Tests added/passed * [x] Requires documentation to be updated * [x] I am a core contributor ## Detailed Description of the Pull Request / Additional comments @miniksa knows much more about this. He's the real MVP. ## Validation Steps Performed 1. Open ubuntu shell 2. double click the : or ~ in cazamor@PC-cazamor:~$ This used to crash. Not anymore! --- <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:09:27 +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#25428