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 new tab 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 (⌃⇧Y on a Mac) opens your conversations in a panel docked along the bottom of the pane, with All and Current Directory tabs and a search field; Continue Last Conversation in the command palette resumes the most recent one.
- 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.
After a restart
With Settings → Features → Restore tabs and panes on start on, Mel reopens your tabs, panes and each pane's folder when it starts. Only the layout comes back, plus the conversation a pane held: commands that were running are not started again.
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