OSC 2 doesn't handle a blank title correctly #21328

Closed
opened 2026-01-31 07:41:07 +00:00 by claunia · 0 comments
Owner

Originally created by @j4james on GitHub (Feb 29, 2024).

Windows Terminal version

1.20.10572.0

Windows build number

10.0.19045.4046

Other Software

No response

Steps to reproduce

In a WSL bash shell execute, the following statement:

printf '\e]2;ERASE THIS\e\\\e]2;\e\\' ; read

This is setting the title to "ERASE THIS" and then immediately after setting it to a blank string. The read is just to allow time to view the result, in case the shell tries to change the title to something else.

Expected Behavior

The title should be reset to the default value, or at least a blank title. For example, this is what it looks like in XTerm:
image

Actual Behavior

The blank title sequence has no effect, and the title is left as "ERASE THIS":
image

Note that you should also be able to reset the title with \e]2\e\\ (i.e. no semicolon after the 2), although not all terminals support that.

Originally created by @j4james on GitHub (Feb 29, 2024). ### Windows Terminal version 1.20.10572.0 ### Windows build number 10.0.19045.4046 ### Other Software _No response_ ### Steps to reproduce In a WSL bash shell execute, the following statement: ``` printf '\e]2;ERASE THIS\e\\\e]2;\e\\' ; read ``` This is setting the title to "ERASE THIS" and then immediately after setting it to a blank string. The `read` is just to allow time to view the result, in case the shell tries to change the title to something else. ### Expected Behavior The title should be reset to the default value, or at least a blank title. For example, this is what it looks like in XTerm: ![image](https://github.com/microsoft/terminal/assets/4181424/33df2670-3f5e-4d6b-9632-7858d98da92b) ### Actual Behavior The blank title sequence has no effect, and the title is left as "ERASE THIS": ![image](https://github.com/microsoft/terminal/assets/4181424/5f8e5132-8e76-4770-9bc8-248ecd58ee0a) Note that you should also be able to reset the title with `\e]2\e\\` (i.e. no semicolon after the `2`), although not all terminals support that.
claunia added the Needs-TriageIssue-Bug labels 2026-01-31 07:41:07 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21328