[PR #3015] [MERGED] Don't put NUL in the buffer in VT mode #25202

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/3015
Author: @zadjii-msft
Created: 10/1/2019
Status: Merged
Merged: 10/3/2019
Merged by: @zadjii-msft

Base: masterHead: dev/migrie/b/1825-NUL-centos


📝 Commits (6)

📊 Changes

2 files changed (+52 additions, -3 deletions)

View changed files

📝 src/host/ut_host/ScreenBufferTests.cpp (+44 -3)
📝 src/terminal/parser/OutputStateMachineEngine.cpp (+8 -0)

📄 Description

Summary of the Pull Request

Filter NUL from the stream when emitted in VT processing mode. Linux terminals can't really have a NUL in their "buffer" - the NUL characters are just ignored. For this particular bug, screen was writing a long sequence of NUL bytes as effectively a timeout, so that it could "flash" the screen.

References

PR Checklist

Detailed Description of the Pull Request / Additional comments

This PR is here for discussion - I'm a tad bit worried that it might regress some scenario unintentionally. cmd.exe uses VT processing for its own scripts and internal commands, is there something here we might be breaking? I doubt it, but I'm unsure.

Validation Steps Performed

  • tested on a centos VM with screen to ensure this actually fixes the problem at hand.

🔄 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/3015 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 10/1/2019 **Status:** ✅ Merged **Merged:** 10/3/2019 **Merged by:** [@zadjii-msft](https://github.com/zadjii-msft) **Base:** `master` ← **Head:** `dev/migrie/b/1825-NUL-centos` --- ### 📝 Commits (6) - [`afcec4d`](https://github.com/microsoft/terminal/commit/afcec4d62b86fb9d03132ec64df82974e74fb702) Potentially fixes #1825 - [`99ca04b`](https://github.com/microsoft/terminal/commit/99ca04b74bff13240d1f534a9b13bf8bd1780241) Merge remote-tracking branch 'origin/master' into dev/migrie/b/1825-NUL-centos - [`9171c44`](https://github.com/microsoft/terminal/commit/9171c44afa3346fd1e6c3d3a7f17474eb4446cd8) add a comment - [`f019862`](https://github.com/microsoft/terminal/commit/f019862d5cc7864904d94acd0e0bb64ae472addb) Merge remote-tracking branch 'origin/master' into dev/migrie/b/1825-NUL-centos - [`1b8a93d`](https://github.com/microsoft/terminal/commit/1b8a93de151134024a114e4c957d31b90e0ca5b1) woah hey this test was wrong - [`ff03b35`](https://github.com/microsoft/terminal/commit/ff03b354d879cfcebf7321a361caf9a3ce448230) Revert bx.ps1 ### 📊 Changes **2 files changed** (+52 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/host/ut_host/ScreenBufferTests.cpp` (+44 -3) 📝 `src/terminal/parser/OutputStateMachineEngine.cpp` (+8 -0) </details> ### 📄 Description ## Summary of the Pull Request Filter NUL from the stream when emitted in VT processing mode. Linux terminals can't really have a NUL in their "buffer" - the NUL characters are just ignored. For this particular bug, `screen` was writing a long sequence of NUL bytes as effectively a timeout, so that it could "flash" the screen. ## References ## PR Checklist * [x] Closes #1825 * [x] I work here * [x] Tests added/passed * [n/a] Requires documentation to be updated ## Detailed Description of the Pull Request / Additional comments This PR is here for discussion - I'm a tad bit worried that it might regress some scenario unintentionally. `cmd.exe` uses VT processing for its own scripts and internal commands, is there something here we might be breaking? I _doubt_ it, but I'm unsure. ## Validation Steps Performed * tested on a centos VM with `screen` to ensure this actually fixes the problem at hand. --- <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:07:56 +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#25202