Terminals
What it is
Section titled “What it is”A terminal is a shell in a pseudo-terminal, owned by a holder: a small process of its own that keeps the shell, its screen and its history. Nothing you close takes it down, not the window, not the CLI, not the daemon. It is for what should keep running: a server, a long test run, a REPL. An agent is a terminal that runs an AI CLI. See Concepts.
Try it
Section titled “Try it”Create one in the project you are in, and attach to it:
$ cd ~/code/app$ wdx terminal create --name servercreated terminal server in app dir /home/you/code/app shell /usr/bin/zsh id term-d69a3fb4$ wdx terminal attach --name serverIt takes the whole window, as tmux does. C-\ d detaches and leaves it running; C-\ [ and C-\ ] scroll through its history; C-\ ? lists the keys. Attach again from any window, or from several at once.
See what you have, and read what scrolled off its screen without attaching:
$ wdx terminal listNAME STATE DIR IDserver running /home/you/code/app term-d69a3fb4$ wdx terminal history --name server --tail 3777879A shell that ended, or whose holder was killed, starts again under the same name:
$ wdx terminal get --name serverterminal server in app state lost dir /home/you/code/app ...$ wdx terminal start --name serverstarted terminal server in app dir /home/you/code/app shell /usr/bin/zsh id term-d69a3fb4In TIDE
Section titled “In TIDE”The pane along the bottom of TIDE’s window holds the project’s terminals, one tab each. C-\ shows or hides it, focusing it when it opens, and what you type then goes to the shell. C-q t creates a terminal, C-q g starts the one shown again once it has ended, and C-q x removes it. Scroll back with the mouse wheel or PageUp. TIDE has no screen for terminal get, nor for history, which is for scripts: scrolling back is the same history. More in Layout and keys.
How it behaves
Section titled “How it behaves”- Where it runs. In the working directory if that is in the project, else in the project’s clone. The shell is the
terminal.shellsetting, your login shell by default. - Names are generated, such as
swift-falcon, unless--namegives one. They have letters, numbers and-only, and are unique in a project among terminals and agents. - It outlives wdx. Restarting or updating the daemon leaves every shell running; the daemon finds its holders again when it starts.
- States.
running;exitedwhen the shell ended by itself, with its exit code;stoppedwhen closing the project stopped it, to start again when the project opens;failedwhen it could not start, with why;lostwhen its holder went with no one stopping it, as after a reboot or akill -9. Every state stays listed until the terminal is removed. - Starting again keeps the id, name and directory, with a fresh shell: what ran in the old one is gone. Its history is kept.
- History is kept on disk for the terminal’s whole life, across restarts of its shell, up to
terminal.history_lineslines.--tail, or--fromand--count, pick the lines; colors are kept on a terminal and stripped with--plain. - Removing a terminal with its shell running asks first, since that ends what runs there;
--stop-runningor--cancelanswers in advance, and with--jsonone is required. - Typing into one from a script is
wdx terminal send, in Messages and sending.
Commands
Section titled “Commands”| Command | What it does |
|---|---|
wdx terminal create | Create a terminal and start its shell |
wdx terminal attach | Show a terminal full-window and type into it, as tmux does |
wdx terminal list | List terminals |
wdx terminal get | Show a terminal |
wdx terminal history | Print the lines that scrolled off a terminal's screen |
wdx terminal start | Start a fresh shell for a terminal that exited, failed or was lost |
wdx terminal remove | Delete a terminal |