Sessions & working directory
How Mel tracks each pane's directory and restores your session state.
A session is one pane's ongoing life: its shell, its working directory, its blocks, its chips, and any agent conversations it hosts. Every pane — in every tab, on every side of every split — is its own session.
Working directory tracking
Mel tracks each pane's cwd so block headers, chips, and autocomplete always reflect where you actually are. Two rules keep it honest:
- The cwd only moves when a
cdsucceeds — the command must exit 0. A failedcd /nonexistentnever moves the tracked directory. - The target must canonicalize to a real directory before it's adopted.
cd inside an agent conversation counts too: when the agent successfully changes directory, the owning pane follows.
The tracked cwd drives more than the header — it's where project/runtime detection walks up from, the base for filesystem completion, the validation anchor for history cd suggestions, and the directory new splits and relative tab-config paths resolve against.
Startup commands
Panes opened from a tab config can carry startup commands; they run as the pane's first block on its first frame. Combined with per-pane directory, this is how a single ctrl+T can open a pre-arranged workbench with servers and CLI agents already launching.
Conversation minis in scrollback
Agent conversations belong to their session. Press esc in a conversation (with the input unfocused) and it collapses into a mini block in the pane's scrollback — a compact row with a ✓, the conversation's title, and a chevron — sitting in run order among your command blocks.
- Click a mini to reopen the conversation with its full transcript and model.
- ctrl+shift+Y resumes the pane's most recent conversation without hunting for the card.
- The
/conversationsslash command opens a searchable picker over all saved conversations — see Input and the prompt.
Conversations are saved to disk after every turn, so minis survive beyond the moment — see Settings files.
Scrollback shape
Fresh sessions bottom-anchor their content: blocks and minis hug the prompt rather than the top of the pane, so the newest thing is always beside your cursor. Session scrollback keeps up to 5,000 blocks — see Blocks for the limits.
Related
- Split panes — sessions side by side
- Environment — what environment each session's commands see