[PR #3215] [MERGED] html: make sure we allocate enough space for the \0, always close #25281

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/3215
Author: @DHowett-MSFT
Created: 10/15/2019
Status: Merged
Merged: 10/17/2019
Merged by: @miniksa

Base: masterHead: dev/duhowett/clapboard


📝 Commits (1)

  • 1f6fe50 html: make sure we allocate enough space for the \0, always close

📊 Changes

1 file changed (+37 additions, -32 deletions)

View changed files

📝 src/interactivity/win32/Clipboard.cpp (+37 -32)

📄 Description

conhost has been leaving the clipboard open for all HTML copies because
StringCchCopyA needs an extra byte for the null terminator and we
haven't been giving it one. We should also make sure that we always
close the clipboard (always).

PR Checklist

  • Closes an untracked bug that was driving me crazy
  • CLA
  • Tested
  • Requires documentation to be updated
  • Core

Validation Steps

Went mad on the clipboard.


🔄 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/3215 **Author:** [@DHowett-MSFT](https://github.com/DHowett-MSFT) **Created:** 10/15/2019 **Status:** ✅ Merged **Merged:** 10/17/2019 **Merged by:** [@miniksa](https://github.com/miniksa) **Base:** `master` ← **Head:** `dev/duhowett/clapboard` --- ### 📝 Commits (1) - [`1f6fe50`](https://github.com/microsoft/terminal/commit/1f6fe50af2b5a886b62e6d1f585f16fbe82f9cd3) html: make sure we allocate enough space for the \0, always close ### 📊 Changes **1 file changed** (+37 additions, -32 deletions) <details> <summary>View changed files</summary> 📝 `src/interactivity/win32/Clipboard.cpp` (+37 -32) </details> ### 📄 Description conhost has been leaving the clipboard open for all HTML copies because StringCchCopyA needs an extra byte for the null terminator and we haven't been giving it one. We should also make sure that we always close the clipboard (always). ## PR Checklist * [x] Closes an untracked bug that was driving me crazy * [x] CLA * [x] Tested * [ ] Requires documentation to be updated * [x] Core ## Validation Steps Went mad on the clipboard. --- <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:08:29 +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#25281