Conventions
How koshi commands pick their target, how names and ids resolve, what they print, and which output formats they support.
Every koshi subcommand works the same way from inside a session and from any other shell. What changes is how the target is chosen.
Choosing a target
- Inside koshi — an omitted target means the current session, tab, pane, or client.
- Outside koshi — give a target, unless exactly one session is running. Then koshi uses it. Zero or several running sessions fail rather than guess.
Targets are passed as --session, --tab, --pane, and --client, and take
the ids that create and list commands print.
One running session plus koshi new-tab puts a tab in that session. Two running
sessions plus the same command fails with
several sessions are running; name one with --session <name-or-id>.
new-pane, run, and new-tab need a terminal attached to the session. A
session with nothing attached refuses them with
no client is attached to the session.
Names and ids
A flag written NAME_OR_ID takes either the target's generated name or its
printed id:
koshi kill-session S-amber-fox
koshi kill-session session-3f2a…koshi generates every session and tab name; no command sets one. A session
name reads S-<adjective>-<noun> and a tab name T-<adjective>-<noun>, with
English, Japanese, or Traditional Chinese words, such as S-amber-fox or
T-しずか-りす.
A value that reads as an id is always used as an id — it never falls back to a
name lookup. A name that several targets share is refused, and the error lists
every matching id. --pane and --client take ids only.
What create commands print
| Command | Prints |
|---|---|
koshi new-pane | one pane id |
koshi run | one pane id |
koshi new-tab | its tab id and root pane id |
koshi --headless | its session id |
Ids print on stdout in creation order:
koshi new-tab
[TAB ID]: tab-<uuid>
[PANE ID]: pane-<uuid>Each line is labelled, so take the id off the end of it before reusing it:
pane=$(koshi new-pane --direction right | awk '{print $NF}')
koshi input --pane "$pane" "cargo watch -x test"Commands that create nothing print no id line.
Output format
List and inspect commands accept --format:
koshi list-panes --format table # default, for reading
koshi list-panes --format json # for scriptsLaunching
| Command | Result |
|---|---|
koshi | Start one session with one tab and shell pane, attached to this terminal |
koshi --profile <NAME> | Start from profile/<NAME>.kdl |
koshi --headless | Start a session with nothing attached, print its id, and return |
The command map
Sessions
attach, detach, kill-session, --headless
Panes
new-pane, run, close-pane, resize-pane, focus-pane, input
Tabs
new-tab, close-tab, next, previous, focus, move
Discovery
list-sessions, list-tabs, list-panes, list-clients, inspect
Input lock
lock, unlock, toggle-lock
Keys and actions
keys list, describe, conflicts, validate; actions list, explain
Config
config path, explain, check, migrate
Debug
debug dump-state, debug dump-layout
Update
koshi update