[PR #1161] Convert CommandHistory to a std::shared_ptr #24512

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

Original Pull Request: https://github.com/microsoft/terminal/pull/1161

State: closed
Merged: Yes


Summary of the Pull Request

CommandHistory becomes a std::shared_ptr. Minor changes in code and unit tests.
Some ctor has been modified.
There is not weak_ptr usage or raw pointer. Every times a shared_ptr is passed, its using the ref counter of the = operator. It prevents unexpected behaviour and hangs.

References

My previous PR 1148 was bad quality. you can cancel it.

PR Checklist

Detailed Description of the Pull Request / Additional comments

Previous commit was a mistake, it involves modifcations and both the migration to vs2019 and platform toolset v142.
The new PR is juts handling H/CPP modifications.
Worked in VS2017 OK.

Validation Steps Performed

Manuel test of running tab and ask for cmd and type command, and ask for history...

**Original Pull Request:** https://github.com/microsoft/terminal/pull/1161 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request CommandHistory becomes a std::shared_ptr. Minor changes in code and unit tests. Some ctor has been modified. There is not weak_ptr usage or raw pointer. Every times a shared_ptr is passed, its using the ref counter of the = operator. It prevents unexpected behaviour and hangs. ## References My previous PR 1148 was bad quality. you can cancel it. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [X] Closes #1058 [X] Cancel PR https://github.com/microsoft/terminal/pull/1148/ [X] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [x] Tests added/passed * [ ] Requires documentation to be updated [X ] 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 Previous commit was a mistake, it involves modifcations and both the migration to vs2019 and platform toolset v142. The new PR is juts handling H/CPP modifications. Worked in VS2017 OK. ## Validation Steps Performed Manuel test of running tab and ask for cmd and type command, and ask for history...
claunia added the pull-request label 2026-01-31 09:03:44 +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#24512