Skip to content

Add play button to run the session's main project #33

@AThraen

Description

@AThraen

Summary

Add a "play" / run button to the session toolbar that executes a configurable command in the session's terminal. Per-project (or per-language/per-framework) configuration so the button does the right thing for each working folder.

Motivation

When a session is open on a project folder, the most common follow-up action is to run / start / build it. Today this means typing dotnet run, npm start, cargo run, python main.py, etc. by hand. A one-click "play" button would cut that to a single keystroke and make CodeShellManager feel more like an IDE harness.

Proposed behavior

  • New play () button on the per-session toolbar (next to the existing 💤 / ✕ controls).
  • Click sends a configured command to the active terminal (as if typed + Enter), so output streams normally and indexing/alert detection still works.
  • Disabled / hidden when no run command is configured for the session.

Configuration

Per-session run command, persisted on ShellSession:

  • RunCommand: string? — explicit override (highest priority)
  • Fall back to project-type detection on WorkingFolder:
    • *.sln / *.csprojdotnet run
    • package.json with a start script → npm start (or pnpm / yarn / bun if their lockfile is present)
    • Cargo.tomlcargo run
    • pyproject.toml / requirements.txtpython main.py (configurable)
    • Makefile with a run target → make run
  • Settings page entry to add / edit project-type → command mappings (similar to CommandPresetsService).
  • Right-click on the play button → "Configure run command…" opens an editor for that session.

Open questions

  • Should the play button confirm before sending if a command is already running in the terminal?
  • Should there be a global keybinding (Ctrl+R / F5)?
  • For SSH sessions, run command is sent over the existing PTY — same path, just verifying it works.

Out of scope

  • Build vs run vs test split (would be a follow-up — possibly a small dropdown next to play).
  • Spawning a separate terminal to host the run process (current proposal reuses the active terminal).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions