danielmiessler / danielmiessler/LifeOS

Proposal: tmux backend for setTabState(), and a fan-out for the canonical session name

Open
#1,879 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
19k
Forks
2.5k
Avg merge
8d 17h
Merged PRs (30d)
1

Description

Two related gaps, offered as a design proposal rather than an unsolicited large PR. Happy to send either as a PR if the shape is wanted.

### 1. `setTabState()` has no tmux backend

`hooks/lib/tab-setter.ts` states the contract in its own header — one env-detecting setter, and *"all hooks call setTabState() instead of directly running terminal commands."* It detects cmux and Kitty. Under tmux it does nothing, so a tmux user gets no tab state at all.

tmux is straightforward to add: `$TMUX_PANE` is exported into every process tmux spawns, so a hook can always resolve which pane it is in via `tmux display-message -p -t $TMUX_PANE '#{session_id}'`, and `#{session_id}` (`$N`) is stable across renames.

### 2. The canonical session name has no fan-out

`MEMORY/STATE/session-names.json` is the authority, but each surface is written by hand at the point the name is decided — work.json here, the transcript row there. Adding a surface means editing whoever decides the name, and a name set from anywhere else (`SessionRename.ts`, an out-of-band edit) reaches nothing.

A small `renderSessionName(sessionId, name)` that reconciles the surfaces would make the write sites one-liners and remove the class. Reconciling rather than pushing also covers the case where a session is renamed from another pane and never gets another prompt of its own.

One correctness note if this is implemented: only the session the process is running *inside* may resolve its tmux session from the ambient `$TMUX_PANE`. For any other session that env var names the caller's pane, and trusting it renames the wrong session. A persisted uuid → `#{session_id}` map handles the rest.

Related: #1878 fixes the transcript surface, which is currently dead for a different reason.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with hooks/lib/tab-setter.ts and MEMORY/STATE/session-names.json, then inspect the name write sites mentioned in the issue, including SessionRename.ts and the related #1878 change. Define done as tmux tab state working for the current session and canonical names staying consistent across the described surfaces without renaming the caller’s session.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.