[PR #15062] [MERGED] fix: WpfTerminalControl allow Connection set to null #30382

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/15062
Author: @mitchcapper
Created: 3/29/2023
Status: Merged
Merged: 4/14/2023
Merged by: @DHowett

Base: mainHead: bug_wpf_terminal_null_connection_fix_pr


📝 Commits (1)

  • bfa3990 fix: WpfTerminalControl allow Connection set to null

📊 Changes

1 file changed (+16 additions, -3 deletions)

View changed files

📝 src/cascadia/WpfTerminalControl/TerminalContainer.cs (+16 -3)

📄 Description

Hides the cursor when null, shows it when not.
Clear the screen any time the connection is changed.

Summary of the Pull Request

Prevents the WPF Control from crashing when set back to null, clears the console and hides the mouse as well.

References and Relevant Issues

#15061

Detailed Description of the Pull Request / Additional comments

It say 3 ansi commands as well now:

  1. When the Connection is set to null the cursor is hidden (reflects what the default state is)
  2. When the Connection is set to a value and it was null before we show the cursor (not a breaking change as requires it to have been null which previously would cause a crash, except for for set)
  3. When the Connection is changed the screen is cleared. A breaking change officially although not sure if there are use cases where this behavior is not desired. For added safety we could make sure we are not being set to the same value we currently are.

None of the ansi commands are needed, users could do it all themselves as well, the behavior largely seemed natural though. I didn't see any ansi constants anywhere so they are just hard coded with comments, but not sure if there is an established better practice.

Closes #15061


🔄 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/15062 **Author:** [@mitchcapper](https://github.com/mitchcapper) **Created:** 3/29/2023 **Status:** ✅ Merged **Merged:** 4/14/2023 **Merged by:** [@DHowett](https://github.com/DHowett) **Base:** `main` ← **Head:** `bug_wpf_terminal_null_connection_fix_pr` --- ### 📝 Commits (1) - [`bfa3990`](https://github.com/microsoft/terminal/commit/bfa399032ef01c60a7e8048707ea4ffd8239a573) fix: WpfTerminalControl allow Connection set to null ### 📊 Changes **1 file changed** (+16 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/WpfTerminalControl/TerminalContainer.cs` (+16 -3) </details> ### 📄 Description Hides the cursor when null, shows it when not. Clear the screen any time the connection is changed. ## Summary of the Pull Request Prevents the WPF Control from crashing when set back to null, clears the console and hides the mouse as well. ## References and Relevant Issues #15061 ## Detailed Description of the Pull Request / Additional comments It say 3 ansi commands as well now: 1) When the Connection is set to null the cursor is hidden (reflects what the default state is) 2) When the Connection is set to a value and it was null before we show the cursor (not a breaking change as requires it to have been null which previously would cause a crash, except for for set) 3) When the Connection is changed the screen is cleared. A breaking change officially although not sure if there are use cases where this behavior is not desired. For added safety we could make sure we are not being set to the same value we currently are. None of the ansi commands are needed, users could do it all themselves as well, the behavior largely seemed natural though. I didn't see any ansi constants anywhere so they are just hard coded with comments, but not sure if there is an established better practice. Closes #15061 --- <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:40: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#30382