Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset title sequences have stopped working in Windows Termial #17800

Closed
j4james opened this issue Aug 26, 2024 · 2 comments · Fixed by #17802
Closed

Reset title sequences have stopped working in Windows Termial #17800

j4james opened this issue Aug 26, 2024 · 2 comments · Fixed by #17802
Labels
Area-VT Virtual Terminal sequence support In-PR This issue has a related PR Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Priority-3 A description (P3) Product-Terminal The new Windows Terminal.

Comments

@j4james
Copy link
Collaborator

j4james commented Aug 26, 2024

Windows Terminal version

Commit f93347e

Windows build number

10.0.19045.4780

Other Software

No response

Steps to reproduce

  1. Open a WSL bash shell in a recent build of Windows Terminal (I suspect it needs to be 450eec4 or later).
  2. Make sure your shell isn't configured to set the title itself.
  3. Set the title with an OSC 0 sequence: printf "\e]0;Test\e\\"
  4. Note that the title has changed.
  5. Reset the title with a blank OSC 0 sequence: printf "\e]0\e\\"

Expected Behavior

The title should be reset to its starting value. This works correctly in Terminal Preview and also in current builds of OpenConsole.

Actual Behavior

The title is just set to a blank value. The same problem occurs with the DECSWT title sequence too.

@j4james j4james added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Aug 26, 2024
Copy link

We've found some similar issues:

If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.

Note: You can give me feedback by 👍 or 👎 this comment.

@j4james
Copy link
Collaborator Author

j4james commented Aug 26, 2024

Nice find Mr Bot, but I fixed that issue, and now it's regressed again.

@microsoft-github-policy-service microsoft-github-policy-service bot added the In-PR This issue has a related PR label Aug 26, 2024
@lhecker lhecker added Area-VT Virtual Terminal sequence support Product-Terminal The new Windows Terminal. Priority-3 A description (P3) and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Aug 26, 2024
lhecker pushed a commit that referenced this issue Aug 26, 2024
## Summary of the Pull Request

When a VT title sequence sets the title to a blank string, that is meant
to trigger a reset to the default starting value. This used to work in
the past because the blank value was dealt with by conhost, so Windows
Terminal never received a blank title, but that's no longer the case
with the new VT passthrough. This PR fixes the issue by getting Windows
Terminal to handle the blank title strings itself. 

## References and Relevant Issues

VT passthrough was introduced in PR #17510.

## Validation Steps Performed

I've manually verified that the `OSC 0`, `OSC 2`, and `DECSWT` sequences
now correctly reset the title when passed a blank title string. 

## PR Checklist
- [x] Closes #17800
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Tag-Fix Doesn't match tag requirements label Aug 26, 2024
@github-project-automation github-project-automation bot moved this to To Cherry Pick in 1.22 Servicing Pipeline Aug 26, 2024
@DHowett DHowett moved this from To Cherry Pick to Cherry Picked in 1.22 Servicing Pipeline Sep 4, 2024
DHowett pushed a commit that referenced this issue Sep 4, 2024
## Summary of the Pull Request

When a VT title sequence sets the title to a blank string, that is meant
to trigger a reset to the default starting value. This used to work in
the past because the blank value was dealt with by conhost, so Windows
Terminal never received a blank title, but that's no longer the case
with the new VT passthrough. This PR fixes the issue by getting Windows
Terminal to handle the blank title strings itself.

## References and Relevant Issues

VT passthrough was introduced in PR #17510.

## Validation Steps Performed

I've manually verified that the `OSC 0`, `OSC 2`, and `DECSWT` sequences
now correctly reset the title when passed a blank title string.

## PR Checklist
- [x] Closes #17800

(cherry picked from commit 1f71568)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgSNvr0 PVTI_lADOAF3p4s4AmhmQzgSOFrc
Service-Version: 1.22
@DHowett DHowett moved this from Cherry Picked to Shipped in 1.22 Servicing Pipeline Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-VT Virtual Terminal sequence support In-PR This issue has a related PR Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Projects
Development

Successfully merging a pull request may close this issue.

4 participants
@lhecker @j4james and others