Skip to content

[Bug]: PTY reader thread is not joinable, bleeding old-session output after respawn #79

@matiaspalmac

Description

@matiaspalmac

Describe the bug

spawn_pty in apps/desktop/src-tauri/src/pty.rs:68,79-91,135 starts a reader thread with thread::spawn but never tracks its JoinHandle and never signals cancellation. When the PTY state is replaced (drop + new), the old reader keeps running on a cloned reader until EOF and can emit pty-output events containing bytes from the previous shell into the new tab.

Steps to Reproduce

  1. Spawn a PTY, run a long-running command (e.g. ping -t localhost on Windows).
  2. Close the bottom panel and immediately reopen it (which triggers a new spawn_pty).
  3. Observe residual ping output appearing in the new terminal for a brief moment.

Trixty Version

v1.0.10

What operating system are you using?

Windows

Would you like to fix this bug yourself by sending a PR?

Maybe

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions