[PR #10326] [MERGED] Remove CONSOLE_API_MSG::UpdateUserBufferPointers hack #27986

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/10326
Author: @lhecker
Created: 6/4/2021
Status: Merged
Merged: 6/14/2021
Merged by: @undefined

Base: mainHead: dev/lhecker/api-msg-copy


📝 Commits (2)

  • 29d9365 Remove CONSOLE_API_MSG::UpdateUserBufferPointers hack
  • 555123b Fix invalid use of inline constexpr

📊 Changes

4 files changed (+80 additions, -84 deletions)

View changed files

📝 .github/actions/spelling/allow/apis.txt (+1 -0)
📝 src/server/ApiMessage.cpp (+44 -30)
📝 src/server/ApiMessage.h (+31 -33)
📝 src/server/WaitBlock.cpp (+4 -21)

📄 Description

Summary of the Pull Request

This commit introduces a copy constructor/operator for
_CONSOLE_API_MSG. The change is not trivial as the struct contains a
union of unnamed structs that cannot be copied using regular language
features. As such a copy operator using memcpy was implemented.
Additionally all access specifiers were removed, as those allow a C++
compiler to reorder struct members. This would break message passing.
This commit is a good opportunity to prevent such miscompilations
proactively.

Validation Steps Performed

  • Command prompts of WSL2 fish-shell and pwsh still work ✔️

Closes #10076


🔄 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/10326 **Author:** [@lhecker](https://github.com/lhecker) **Created:** 6/4/2021 **Status:** ✅ Merged **Merged:** 6/14/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/lhecker/api-msg-copy` --- ### 📝 Commits (2) - [`29d9365`](https://github.com/microsoft/terminal/commit/29d936573ae24aac46b295487dba4ac104d35d9d) Remove CONSOLE_API_MSG::UpdateUserBufferPointers hack - [`555123b`](https://github.com/microsoft/terminal/commit/555123bff5e70c2d508d1f09ff09c36528a56542) Fix invalid use of inline constexpr ### 📊 Changes **4 files changed** (+80 additions, -84 deletions) <details> <summary>View changed files</summary> 📝 `.github/actions/spelling/allow/apis.txt` (+1 -0) 📝 `src/server/ApiMessage.cpp` (+44 -30) 📝 `src/server/ApiMessage.h` (+31 -33) 📝 `src/server/WaitBlock.cpp` (+4 -21) </details> ### 📄 Description ## Summary of the Pull Request This commit introduces a copy constructor/operator for `_CONSOLE_API_MSG`. The change is not trivial as the struct contains a union of unnamed structs that cannot be copied using regular language features. As such a copy operator using `memcpy` was implemented. Additionally all access specifiers were removed, as those allow a C++ compiler to reorder struct members. This would break message passing. This commit is a good opportunity to prevent such miscompilations proactively. ## Validation Steps Performed * Command prompts of WSL2 fish-shell and pwsh still work ✔️ Closes #10076 --- <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:25:34 +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#27986