The ztcl shell

This is the shell of the ztcl program, compiled to WebAssembly. The line editor, the completion, and the colors are the same code as in your terminal. A terminal of ztcl::vt (libghostty-vt) in the same module holds the screen, and the page renders its cells on a canvas. The shell has no access to files, the network, or the clock. Each command can use 10,000,000 compute units.

ztcl shell
Tab completes. Up is history. Ctrl-R searches it. Ctrl-X Ctrl-E edits. Alt-I inspects the last result. Esc Tab leaves. Compute limit: 10,000,000 compute units for each command

Completion

Tab completes command names, namespaces, the subcommands of an ensemble (string tou), variables after $, TclOO methods, and the names of the read-only files of this page. With more than one match, a menu shows them, and Tab again puts in each one in turn.

Keys

  • Up and Down go through the history. A gray hint after the cursor is the newest match; Right arrow puts it in.
  • The vim keys box is the same as shell mode vi. Escape goes to normal mode, and v opens the editor.
  • Ctrl-X Ctrl-E opens the command in an editor in the page.
  • Escape and then Tab moves the focus out of the shell.

Limits

The meter shows the compute units of the last command. A command that uses all 10,000,000 stops with an error, and the next command gets the full count again. The memory limit is 64 MiB. Each completion can use 1,000,000 compute units. The limits page defines a compute unit, and the shell docs list all keys.