feat: session layouts, breadcrumb discovery, /wttab, pane titles/profiles#2
Open
AsafMah wants to merge 4 commits into
Open
feat: session layouts, breadcrumb discovery, /wttab, pane titles/profiles#2AsafMah wants to merge 4 commits into
AsafMah wants to merge 4 commits into
Conversation
…iles Adds a tested multi-pane layout primitive, plugin-agnostic session discovery, completes the command set, and enriches single-pane options. Commands & tools - /wttab: open the session in a new tab (completes /wtpane + /wtwindow). - /wtpane now accepts an optional [vertical|horizontal] split direction. - spawn_session_pane: optional title/profile. - list_omp_sessions (new): list recent omp terminals — including ones this extension did not start — from core's breadcrumb registry, newest first. - arrange_sessions (new): open several sessions as even columns/rows in one window, each resumed in its recorded cwd. Internals - buildWtArgs emits -p/--title/-s; shared paneTailArgs helper. - buildLayoutArgs: one chained `wt` argv (`;`-delimited) with an even-slice size formula; reuses the WSL adapter per pane (adaptLayoutPaneForHost). - discoverTerminalSessions reads <agent>/terminal-sessions/* (cwd + session file per terminal); honors PI_CODING_AGENT_DIR / PI_CONFIG_DIR / profile. - OMP_BIN now supports multi-token commands (ompLauncher). Verification - bun test (24 pass) + tsc clean. - E2E: real buildLayoutArgs output through cmd.exe/wt.exe opened a 3-pane, -s-sized, titled layout (marker files confirmed all panes ran). Docs - README: new tools/commands, an "Arranging & discovering sessions" section, OMP_BIN/PI_CODING_AGENT_DIR config. - Skill routes common cases to arrange_sessions/list_omp_sessions, keeps raw wt.exe for bespoke layouts. - Add GitHub Actions CI (bun test + tsc).
Move the extension's development knowledge into the plugin itself (a skill, like the bundled windows-terminal-control), so it's versioned with the code and surfaced to agents working in this repo rather than living only in a local managed skill. - skills/windows-terminal-dev/SKILL.md: type-only host API, bun test + tsc gates, wt.exe-via-cmd.exe + the `;` argv-quoting verification technique, even-split layout math, breadcrumb session discovery, push/CI notes. - README "Develop": point contributors at it.
Source review of pi-coding-agent SessionManager#rememberBreadcrumb + pi-tui ttyid.getTerminalId showed core writes a breadcrumb only for a persisted session in an *identifiable* terminal — on Windows that's Windows Terminal (WT_SESSION) or a tmux/zellij/kitty/wezterm multiplexer; a plain cmd/PowerShell/conhost console sets no WT_SESSION and leaves none. /tan named forks are suppressed, and only the latest session per terminal is kept. The plugin-vs-not axis was never the boundary (both get breadcrumbs equally) — terminal-identifiability + persistence is. Tighten the overstated "for EVERY terminal" wording in the discoverTerminalSessions docstring, the list_omp_sessions tool description, the README discovery section, and the windows-terminal-dev skill to state the verified coverage boundary.
…ion store
Closes the discovery gap for sessions with no breadcrumb (plain console,
non-interactive, older-than-latest). On this machine the store holds 105
sessions vs 83 breadcrumbs — 56 of them breadcrumb-less, i.e. invisible to
breadcrumb-only discovery.
- scanStoredSessions(): walks <agent>/sessions/<project>/*.jsonl and recovers
{ id, cwd, title } from each file's first-line header, reading only a bounded
16KB slice (never whole files), newest-first by mtime.
- list_omp_sessions gains `source: "breadcrumbs" | "all"` (default unchanged).
"all" lists every persisted session with its recorded cwd/title, marking the
current one via ctx.sessionManager.getSessionFile().
- arrange_sessions resolves explicit `sessions` refs against the store too, so a
breadcrumb-less session still arranges in its recorded directory.
- Tests (27 pass): header recovery + newest-first across projects, non-jsonl /
missing-cwd skip, absent-store empty; env restored in afterEach.
- README + windows-terminal-dev skill document the opt-in store scan.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Builds on the merged WSL support (#1) with a layout primitive, plugin-agnostic
session discovery, the missing tab command, and richer single-pane options.
Commands & tools
/wttab [fork|current]— completes the set alongside/wtpane+/wtwindow./wtpanenow accepts an optional[vertical|horizontal]split direction (was always auto).spawn_session_pane— optionaltitle/profile.list_omp_sessions(new) — lists recent omp terminals, including ones thisextension did not start, from oh-my-pi core's breadcrumb registry, newest first.
arrange_sessions(new) — opens several sessions as even columns or rowsin one window, each resumed in its recorded working directory.
"Sessions not started by the plugin"
Discovery reads core's
~/.omp/agent/terminal-sessions/*breadcrumbs (cwd + sessionfile per terminal), which core writes for every terminal — so arranging/listing
works regardless of how a session was launched. A breadcrumb is a "last seen" marker,
not a liveness signal; the tools surface recency and warn that resuming a session
live elsewhere means two writers on one session file.
Internals
buildWtArgsemits-p/--title/-svia a sharedpaneTailArgs.buildLayoutArgs— one chainedwtargv (;-delimited) with an even-slice sizeformula; reuses the WSL adapter per pane (
adaptLayoutPaneForHost).discoverTerminalSessionshonorsPI_CODING_AGENT_DIR/PI_CONFIG_DIR/ profile.OMP_BINnow supports multi-token commands.Docs & CI
arrange_sessions/list_omp_sessions, keeps rawwt.exefor bespoke grids/focus moves.bun test+tsc).Verification
bun test→ 24 pass / 0 fail;tsc --noEmitclean.buildWtArgstitle/profile/size,buildLayoutArgs(order,-V/-H,;delimiters, even-slice sizes, single-pane, empty-throws),adaptLayoutPaneForHost(WSL wrap + native identity),
discoverTerminalSessions(newest-first, current flag,malformed-skip, missing-dir) — env restored in
afterEach.buildLayoutArgsoutput, run throughcmd.exe /d /s /c wt.exe,opened a 3-pane
-s-sized titled layout — all three panes' marker files were written,confirming the
;-chain splits and per-pane commands execute through the actual launcher.Notes
fully tested). Arbitrary grids via chained
sp/mfare fragile to verify and remainthe skill's domain.