Using the shell
terse-host opens a window and runs a system of machines. The first of them is the shell, a Terse32 program like any other, which starts the others and shows each in a window on a desktop (or, with --shell tiles, as tiles); one of the programs it offers is the reader, where you follow feeds and read articles such as this one. This article describes the shell from the user's side: the keys, the screens, and the prompts the host shows; Using the reader does the same for the reader.
Starting
cargo run --release -p terse-host -- --demo
builds everything, sets up four sample articles and opens the shell. The first time, it creates your feed key (~/.config/terse/identity.key), subscribes you to your own feed and publishes the samples to it; run again, it publishes nothing new. After that, cargo run --release -p terse-host with no image named opens the shell.
Without --relay the host uses the relays listed in relays in the config directory (terse relay add <url> writes it), else a relay already listening on ws://127.0.0.1:7878, else one it starts itself on that port. --relay may be given several times; --relay none runs without a network. To share with someone, one of you runs a relay the other can reach, the other adds it with terse relay add ws://their-host:7878, and you exchange feed addresses (the key, @ and a relay others can reach: the reader's help page and terse feed address show yours). How relays work is in The network.
The 3D drawings, the gallery's included, are seen from an eye that follows the pointer, except while the pointer is over a program that draws in 3D itself: there the eye stays still, so that what you point at stays where the program drew it. --parallax off keeps the eye still everywhere. --renderer software draws with the CPU instead of the GPU, and with it --panels flat draws the gallery's panels upright instead of in perspective (perspective or auto, the default; the GPU always draws them in perspective). Programs in the phosphor style (every program, with --force-phosphor) are drawn on a colour vector monitor; --tube p31, amber or vectrex gives a green, amber or white tube instead (xy is the default), --vignette darkens its corners and --no-trails turns the afterglow off. --look pencil draws everything as pencil on paper and --look engraving as an engraving, ink on paper with hatched fills (see The reference host's look); a program may ask for one with a look hint, which your own options override.
The screen fills the window at 4:3 whatever the window's size, with a dark band only on the other axis. Alt+minus and Alt+equals zoom it out and in, Alt+0 fills the window again, and F11 turns full screen on and off. No program receives these keys.
The desktop
The shell terse-host runs unless told otherwise is the desktop, in the style of the 1990s Common Desktop Environment: each program in a window with a bevelled frame and a title bar, four workspaces, and the front panel along the bottom.
- **The front panel**, from the left: a clock and the date; launchers for Manual, Reader, Soft reader, then the four workspace buttons (One, Two, Three, Four; the current one pressed in), then Sheet, Low Bell, Stillwind, Programs and the Style Manager. A click on a launcher starts its program in a new window, which gets the keyboard; Manual opens the reader on this manual. The small tabs with an arrow above Reader, Programs and the Style Manager are drawers: a click pops up a list. Reader's has the manual and both readers; Programs' has every built-in program, the programs of the feeds you follow, and the states Tersenet saved of slow programs ("Saved: ..."); the Style Manager's has the Style Manager and the session (save, restore, discard).
- **Windows.** A window's title bar shows the program's title (with
(paused),(exited)or(faulted)when it no longer runs, and⚗if it uses an experimental device); the window with the keyboard has the palette's active colour. The buttons: the window menu at the left, then minimise, maximise and close at the right. A program's screen is 4:3, so a window is too, and resizing keeps it so. Title text sits on a row of the screen's text grid, so windows move up and down a row at a time. - **Icons.** A minimised window becomes an icon on the desktop with its title and the program's picture, small and still running.
- **Workspaces.** Each window belongs to one of four workspaces; the panel's buttons switch between them, and the window menu sends a window to another.
| Mouse | |
|---|---|
| Click in a window | raise it and give it the keyboard (the click also reaches the program) |
| Drag the title bar | move the window |
| Drag a border or a corner | resize it, keeping 4:3 |
| Double-click the title bar | maximise it (the largest 4:3 window above the panel, left of the icons), or back |
| The left title button | the window menu: Restore, Minimise, Maximise, Lower, To workspace One to Four, Close (and Restore saved state for a halted program) |
| Click an icon, drag an icon | restore the window, move the icon |
| Second button on the backdrop | the workspace menu: Manual, Style Manager, Save session, Restore session |
| Click the backdrop | the keyboard to the desktop |
F12 is the home key: it gives the keyboard to the desktop (no window is active), and no program ever sees it. The window keys work wherever the keyboard is: the window takes them for the desktop, so programs do not get them.
| Key | On the desktop |
|---|---|
| Alt+Tab, Alt+Shift+Tab | the next or previous window of this workspace (icons too) |
| Alt+F4 | close the top window |
| Alt+Space | its window menu |
| Ctrl+Alt+Left, Ctrl+Alt+Right | the previous or next workspace |
| Tab, Space, Left, Right, 1 to 4 | after F12: as the window keys above, and the workspace with that number |
| S | after F12: save the session |
| Esc | give the keyboard back to the top window; in a menu, close it |
| Up, Down, Enter | in a menu or drawer: choose |
**The Style Manager** sets the colours, from the classic palettes (Default, Alpine, Broica, Crimson, Charcoal, Desert, Lilac, Olive), and the backdrop's pattern (Solid, Dots, Diagonal, Grid, Bricks). A click applies one at once; Esc closes it. The choice is kept for the next run.
**Sessions.** "Save session" (or S after F12) keeps every running program exactly where it is, as snapshots, with its window, workspace, size and whether it is minimised or maximised. The next time the desktop starts it asks whether to restore the session, discard it, or not now (the session drawer offers it again).
**The look.** The frames, the panel, its buttons and the menus are 3D faces, and terse-host fills, lights and shadows them for the desktop. --no-3d-fill and --no-3d-shadows turn that off: the desktop is then line art, and still works the same.
A machine that asks to start another program (a link in an article, a document of a published format) gets a dialog, "<title> asks to start <name> by <publisher> ...", with Yes and No (Y, N, Esc), as below for the tiling shell. A program that exits or faults keeps its window and last picture until you close it.
The tiling shell
terse-host --shell tiles runs the earlier shell, which tiles the machines under a bar, with a launcher: its bar, tiles, layouts, gallery and keys are in The tiling shell. The sections below hold for both shells.
Sessions
S saves the session: every running or paused machine as a snapshot of its whole state, and the layout, the selected machine and how many there are. The bar says "Session saved" or "Could not save the session". When the shell starts and a session was saved, the launcher's first entry is "Restore last session (N programs)": Enter restores the machines in their order, where they were (a game mid-play, the reader on its article at the same place), with the layout and the keyboard on the machine that was selected. D, with the cursor on that entry, discards the session. A machine that cannot be restored (its image is gone from the store and no relay has it, or the snapshot is unreadable) shows why, as a failed start does. A snapshot holds one exact version of a program; named records are not in it. Nothing is saved without S. The snapshot format is in The state hash.
Halted machines
Tersenet watches every frame for the part that made it late, in terse-host, whose devices are built in, as in terse-bus, which runs each device as a driver. A part that keeps making frames late is dealt with:
- **A machine, or a device it uses.** After 3 late frames within a second, Tersenet saves the machine's state and says so; it keeps running, and its line in the launcher says "A device it uses was slow; Tersenet saved its state." After 10 within five seconds it saves it again and stops it: the machine is halted. In
terse-hostonly the machine responsible is halted, not the others. The bar says so once, for example "Tersenet stopped sparks: device 3 was too slow (state saved)"; the tile shows why in words instead of its last picture; and the launcher line says "Tersenet stopped it: ... kept making frames late. Its state was saved: Enter restores it." Enter restores it, in the same tile. - **Tersenet's own drawing.** It first draws the phosphor look more simply. If that is not enough, it says once that it does not keep up on this computer, and records it; it stops no machine. A smaller window may help.
- **Resizing the window.** While the size changes, Tersenet holds the machines, at most a second at a time, and the few frames just after a resize count against no one, within a bound.
A machine is stopped only when Tersenet can tell how long it waited for a processor: Linux with schedstats and macOS say so, and on Windows Tersenet works it out from how long the machine ran and how long the processors stood idle. Where it cannot tell, the machine is warned about and saved, never stopped.
Every state saved this way is listed in the launcher under SAVED BY TERSENET: Enter restores one, D deletes it. There is one place per machine, so a new warning replaces the last save. How slowness is measured and reported is in Performance reports.
Open requests
A machine may ask the shell to open a program (by its identity) or a blob (by its ID); the reader does this when you follow a link to a program, an image or a document. The shell takes these requests only from the machine with the keyboard, one at a time, at most one a second from each machine, and ignores a machine's requests for ten seconds after you say no.
- A built-in program starts at once in a new tile.
- Any other program is fetched first (the host looks it up on its relays if it holds no entry for it); then the bar asks, for example,
reader asks to start Tool by Alice 3fa9c2…c21e07. Y/N. The keyboard goes to the shell until you answer: Y starts it in a new tile with the keyboard, N or Esc does not. - For a blob, the shell reads its first bytes. An image is loaded, but runs nothing before you answer, and is asked about as an unpublished program, with its title and short ID. A document starts the program of its format with the document as its argument (a published format is asked about the first time in a run). Anything else opens in a new reader tile.
- If the program lists an experimental device, the question has a second row saying so (Experimental devices, above).
- A failure (not found, no free handle) is a brief message in the bar.
Consent prompts
A program may ask the host to subscribe to a feed, unsubscribe from one, publish an article or a document in your name, set your public name, or set a nickname. (A program may also open the Publish page to let you write a reply, as the reader's R does; that publishes nothing until you do it there.) The host then shows its own prompt over the bottom four rows of the window, over every machine's picture. The program can neither see nor draw over it.
| Request | The prompt shows |
|---|---|
| Subscribe, unsubscribe | the feed key, as its first and last six hex digits (3fa9c2…c21e07), and the relays a feed address names (the host may connect to them) |
| Publish | whether it is an article or a document, its title and size, and for a reply what it answers |
| Set profile | the display name, and whether search may find it |
| Set nickname | the feed key and the nickname |
Every prompt names the title of the program that asks. Y allows; N or Esc refuses; every other key, Enter included, does nothing. While the prompt is up the keyboard goes to the host, not to any program. Several requests are asked about one at a time. terse-host --consent allow or deny answers every request without asking; ask is the default.
Where to go next
How articles are written: Writing an article. How the shell's devices work: The machines device. Feeds and consent from a program's side: Feeds.