Skip to content

[Feature]: Multi-session PTY with HashMap<SessionId, PtyHandle> and typed events #111

@matiaspalmac

Description

@matiaspalmac

Describe the feature

Today apps/desktop/src-tauri/src/pty.rs:9-12,17,76,97-108,111-128,133-137 stores a single global PTY (ManagedState<Arc<Mutex<Option<PtyState>>>>). A second spawn_pty overwrites the first, and pty-output carries only a String with no session_id, so the frontend cannot route output per tab.

Proposed feature:

  1. Refactor state to Mutex<HashMap<SessionId, PtyHandle>>.
  2. Add session_id: String to the signatures of spawn_pty, write_to_pty, resize_pty, kill_pty.
  3. Emit pty-output with a typed payload { session_id, data }.
  4. Verify with three parallel terminal tabs that output does not cross.

This unblocks a real multi-tab terminal experience.

Would you like to implement this feature yourself by sending a PR?

Maybe

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions