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.

Mouse
Click in a windowraise it and give it the keyboard (the click also reaches the program)
Drag the title barmove the window
Drag a border or a cornerresize it, keeping 4:3
Double-click the title barmaximise it (the largest 4:3 window above the panel, left of the icons), or back
The left title buttonthe 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 iconrestore the window, move the icon
Second button on the backdropthe workspace menu: Manual, Style Manager, Save session, Restore session
Click the backdropthe 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.

KeyOn the desktop
Alt+Tab, Alt+Shift+Tabthe next or previous window of this workspace (icons too)
Alt+F4close the top window
Alt+Spaceits window menu
Ctrl+Alt+Left, Ctrl+Alt+Rightthe previous or next workspace
Tab, Space, Left, Right, 1 to 4after F12: as the window keys above, and the workspace with that number
Safter F12: save the session
Escgive the keyboard back to the top window; in a menu, close it
Up, Down, Enterin 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 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 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.

RequestThe prompt shows
Subscribe, unsubscribethe 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)
Publishwhether it is an article or a document, its title and size, and for a reply what it answers
Set profilethe display name, and whether search may find it
Set nicknamethe 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.