Skip to content

Setting an overly long title causes crash #20847

Open

Description

Windows Terminal version

1.24.12741.0

Windows build number

10.0.19045.6466

Other Software

Ubuntu 24.04.5 LTS under WSL
Linux AMDAHL 4.4.0-19041-Microsoft #5794-Microsoft Mon Apr 07 17:55:00 PST 2025 x86_64 x86_64 x86_64 GNU/Linux

Steps to reproduce

settitle () {
    echo -ne "\033]0;$*\007" > /dev/tty
}

for ((a=1, b=2; ; t=a+b, a=b, b=t))
do
    echo "$a" >> last_length
    settitle "$(head -c "$a" < /dev//zero | tr '\0' 'x')"
    sleep 0.1
done

Running the above script causes Terminal to become unresponsive and then disappear altogether.
As a bonus, we get a nice list of Fibonacci numbers. The last one is 39088169, written just before the crash.

The string sent via the ANSI sequence should be truncated to a sensible length. There's no point in setting a title of one million characters when it can't be displayed, regardless of how small the font is.

Expected Behavior

Windows Terminal keeps running, and at most the active tab gets lost.

Actual Behavior

Windows terminal becomes unresponsive and then the entire window just disappears.

Activity

  1. added
    Issue-BugIt either shouldn't be doing this or needs an investigation.
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on Oct 24, 2026
  2. cherryrodney26 commented on Oct 24, 2026

    @cherryrodney26

    The crash likely occurs because the buffer receiving the OSC 0 sequence is attempting to reallocate or render an arbitrarily large string without a length constraint. You should implement a hard limit on the title length within the OSC string parser, perhaps capping it at a few thousand characters to prevent memory exhaustion or overflow. Have you checked if the crash originates in the string processing layer of the terminal emulator or the underlying rendering engine when it attempts to update the tab metadata?

  3. j4james commented on Oct 25, 2026

    @j4james
    Collaborator

    Duplicate of #20838.

  4. Bu11etmagnet commented on Oct 25, 2026

    @Bu11etmagnet
    Author

    Drat, I tired searching for title and crash but apparently my search-fu was weak.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugIt either shouldn't be doing this or needs an investigation.Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions