Terminal
{active?.directory || cwd}
{#if sessions.length === 1}
{active?.profile.title}
{/if}
addSession()} />
addSession(active?.profile, true)} />
killSession(activeId)} /> {#if !standalone}
{/if}
{#if error}
{error}
error = ""}>×
{/if}
{#each sessions as session (session.id)}
{#if group.length > 1 && session.group === active?.group}
{session.title}
{/if}
activeId = session.id} onState={state => { session.state = state; if (state === "Running" && session.command) { controls.get(session.id)?.send(session.command); session.command = undefined; } }} onControl={control => { if (control) controls.set(session.id, control); else controls.delete(session.id); }} onCommand={command => recentCommands = remember(recentCommands, command)} onDirectory={directory => { session.directory = directory; recentDirectories = remember(recentDirectories, directory); }} /> {#if session.group === active?.group && group.indexOf(session) > 0}
resizeSplit(event, session)}>
{/if}
{/each} {#if !sessions.length}
{loading ? "Detecting terminal profiles…" : "No terminal sessions."}
addSession()}>Start a terminal
{/if}
{#if sessions.length > 1}
{#each sessions as session (session.id)}
item.group === session.group).length > 1}>
select(session.id)} onkeydown={event => { if (event.key === "Delete") { event.preventDefault(); killSession(session.id); } if (event.key === "ArrowDown" || event.key === "ArrowUp") { event.preventDefault(); const next = sessions[(sessions.indexOf(session) + (event.key === "ArrowDown" ? 1 : sessions.length - 1)) % sessions.length]; activeId = next.id; (event.currentTarget.closest("nav")?.querySelector(`[data-session="${next.id}"] .pick`) as HTMLButtonElement)?.focus(); } }}>
›_
{session.title}
{session.state}
{ activeId = session.id; addSession(session.profile, true); }} />
killSession(session.id)} />
{/each}
{/if}
{#if picker}
picker = null} />{/if} {#if showSettings}
showSettings = false} />{/if}