Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

feat(terminal): separate reattach from agent restart, add a header reattach button

enes23138f1ef351
diff --git a/src/renderer/canvas/Canvas.tsx b/src/renderer/canvas/Canvas.tsx
index c7a539d33..c604e733b 100644
--- a/src/renderer/canvas/Canvas.tsx
+++ b/src/renderer/canvas/Canvas.tsx
@@ -59,6 +59,7 @@ import {
IconLock,
IconMarkdown,
IconReload,
+ IconPower,
IconNote,
IconPhone,
IconProject,
@@ -4058,7 +4059,12 @@ export function Canvas() {
...(ids.some((nid) => nodesRef.current.find((n) => n.id === nid)?.type === 'terminal')
? ([
{ label: 'Markdown view', icon: <IconMarkdown />, onClick: () => toggleMarkdown(ids) },
- { label: 'Reload terminal', icon: <IconReload />, onClick: () => reloadTerminals(ids) }
+ {
+ label: 'Reattach terminal',
+ icon: <IconReload />,
+ hint: 'Rebuilds the view and re-attaches to the same session. Nothing running is interrupted.',
+ onClick: () => reloadTerminals(ids)
+ }
] as MenuItem[])
: []),
// Restart the agent CLI itself (single selection): quit it and relaunch with `--resume`, so a
@@ -4092,7 +4098,7 @@ export function Canvas() {
return [
{
label: 'Restart agent (resume)',
- icon: <IconReload />,
+ icon: <IconPower />,
disabled: !!why,
hint: why ?? 'Quits the CLI and relaunches it with --resume (same conversation).',
onClick: () => void restartAgentNode(ids[0])
@@ -4291,7 +4297,7 @@ export function Canvas() {
? [
{
label: 'Restart idle agent sessions (resume)',
- icon: <IconReload />,
+ icon: <IconPower />,
hint: 'Quits each idle agent CLI and relaunches it with --resume.',
onClick: restartIdleAgents
} as MenuItem
@@ -6072,8 +6078,8 @@ export function Canvas() {
{
id: 'restart-idle-agents',
label: 'Restart idle agent sessions (resume)',
- hint: 'new model update',
- icon: <IconReload />,
+ hint: 'pick up a new model',
+ icon: <IconPower />,
run: restartIdleAgents
} as Command
]
diff --git a/src/renderer/components/icons.tsx b/src/renderer/components/icons.tsx
index 7965eef5f..19e368dd9 100644
--- a/src/renderer/components/icons.tsx
+++ b/src/renderer/components/icons.tsx
@@ -158,6 +158,15 @@ export const IconReload = () => (
</svg>
)
+/** Power symbol — restarting a PROCESS (the agent CLI), as opposed to IconReload's
+ * circular arrow, which reloads a VIEW. The two restart actions must not share a glyph. */
+export const IconPower = () => (
+ <svg {...S}>
+ <path d="M12 3v9" />
+ <path d="M7.5 6.3a7.5 7.5 0 1 0 9 0" />
+ </svg>
+)
+
export const IconBranch = () => (
<svg {...S}>
<circle cx="6" cy="6" r="2.5" />
diff --git a/src/renderer/nodes/TerminalNode.tsx b/src/renderer/nodes/TerminalNode.tsx
index 6a3cdaa6c..30478e654 100644
--- a/src/renderer/nodes/TerminalNode.tsx
+++ b/src/renderer/nodes/TerminalNode.tsx
@@ -58,7 +58,7 @@ import {
restartEligibility
} from '../terminal/agent-restart'
import { FindBar } from '../components/FindBar'
-import { IconSearch, IconChat, IconMic } from '../components/icons'
+import { IconSearch, IconChat, IconMic, IconReload } from '../components/icons'
import { NodeTags } from '../components/NodeTags'
import { Tooltip } from '../components/Tooltip'
import { useTerminalSearch } from '../terminal/useTerminalSearch'
@@ -1833,6 +1833,25 @@ export function TerminalNode({ id, data, selected, parentId }: NodeProps<CanvasN
</button>
</Tooltip>
)}
+ {/* Reattach: rebuild THIS node's view and re-attach to the same session (the context
+ menu's "Reattach terminal", one click away). In the header because the cases that
+ need it are exactly the ones where the node is unusable — a pane that never painted,
+ a scroll that stopped responding after a long sleep — and a right-click on a dead
+ view is the last thing a user wants to hunt for. Distinct from "Restart agent
+ (resume)", which quits the CLI itself; this touches nothing but the viewer. */}
+ <Tooltip label="Reattach — rebuild this view; the session keeps running">
+ <button
+ className="term-node__reattach nodrag"
+ onClick={(e) => {
+ e.stopPropagation()
+ updateNodeData(id, (n) => ({
+ respawnNonce: ((n.data.respawnNonce as number | undefined) ?? 0) + 1
+ }))
+ }}
+ >
+ <IconReload />
+ </button>
+ </Tooltip>
<Tooltip label={showUsage ? 'Search terminal + conversation' : 'Search this terminal'}>
<button
className="term-node__search nodrag"
diff --git a/src/renderer/styles.css b/src/renderer/styles.css
index 030a9d5e9..e9ae07919 100644
--- a/src/renderer/styles.css
+++ b/src/renderer/styles.css
@@ -1327,6 +1327,24 @@ body,
color: #6cb0ff;
}
+.term-node__reattach {
+ background: transparent;
+ border: none;
+ color: var(--muted);
+ cursor: pointer;
+ line-height: 1;
+ padding: 2px 5px;
+ border-radius: 4px;
+ flex-shrink: 0;
+ display: inline-flex;
+ align-items: center;
+}
+
+.term-node__reattach:hover {
+ background: rgba(10, 132, 255, 0.18);
+ color: #6cb0ff;
+}
+
.term-node__mic {
background: transparent;
border: none;