/new puts a new session on the screen in the window's own process and the one it left carries on; /back returns to the session focused before, one step either way, as cd - does¶
TUI decision 151 · accepted · 2026-10-08 · issue #484
Issue #484, root Decision 812. The TUI shows one session at a time, and switching was
already one function: adopt/2 unsubscribes, subscribes and rebuilds the screen from the
other log (Decision 65). /new and /back are two more ways into it, not a second window
or a tab bar.
/new.--privateand no flag create a session in the directory on screen withworktree: "never", astroupeandtroupe --privatedo; with a plane's session on screen, in the directory the window was opened in (home), which is also what the picker now lists then, where it listed nothing.--remote PROFILEcreates one on the plane this machine is signed in to (Client.default_plane/0), as HQ's wizard does, with its defaults.--branchisClient.fork_session/1: the daemon'ssession.forkfor a session on this machine, the plane's for a pod's. Anything else is the usage line. The new session takes the screen with the command line focused and empty: what is typed first is its opening message, which is the "optional goal or opening message" the issue asked for, given by the input that is already there.- The session left carries on.
adopt/2lets go of a session nobody typed into, as it always did (Decision 65's scratch session), and keeps every other attached and running. The picker lists the session/backwould return to even when it did nothing, so the session/newleft is always in it. /backis one step.backis the session focused before this one, set by every switch (/new,/resume, the picker, HQ), and going back makes this one the way back:/backtwice is where you were. No stack:/sessionslists the rest, and a stack is a second list to keep in step with the first. A local session is read again first (Client.get_session/2,session.get) and refused as the picker refuses it (root Decision 812), then opened if the daemon had let go of it; a plane's session is still attached, and is put back on the screen.- A bare
neworbackat the start of a line runs the built-in, as every built-in's name does on the command line today;command_palette_test.exsleavesnewout of its walk over every built-in, as it leavesworktree, since it starts a session. - Proof:
new_session_test.exs:/newtakes the screen, the first keeps running and both are in the picker,/backreturns and/backagain comes back (failed on the tip:/newdid nothing);/new --branchshows the conversation so far, its log opens withsession_forked, it has no parent, and its first model request carries the parent's reply while the parent never hears the line typed in the fork;/new --privateis listed private;/new --remote codeand/new --branchon it againstFakeRemote(which now answerssession.fork), and/sessions <id>home from there;/backto a session erased meanwhile is refused with the sentence and the screen stays;mix check. Not tried against a plane, and the installed TUI's keys were not pressed: nothing that checked this types into a running terminal UI. The daemon's half of--branchwas run against the installed daemon (root Decision 812).
Governs: clients/tui/lib/troupe/ui/tui/server.ex, clients/tui/lib/troupe/client/daemon.ex, clients/tui/lib/troupe/client/remote.ex