Skip to content
Tildev0.6.1

The command line

This page explains the command line of tt: the line that : opens at the bottom of the screen, where you type the name of a command and run it.

Terminal window
tt --demo

Type : and the bottom bar becomes a line that starts with :. Type nosuch and press Enter. The line closes and the bottom bar says Unknown command 'nosuch'. The next key puts the status line back, with message 1 of 200. Type :q and Enter to quit.

tt after the command nosuch was typed on the command line: the bottom bar says Unknown command ‘nosuch’. in place of the status line.

This is the line with a command typed, before Enter:

The command line of tt: a colon and the text help.show_keys typed on the bottom line.

  • : opens the line from the list or from the tree. It covers the bottom bar.
  • Enter closes the line and runs it. Esc closes it and runs nothing.
  • The first word is the name of the command, and the other words go to it. :index.first 3 does what 3gg does.
  • Words are split on spaces. Double quotes make one word of several: :search.run "weekly report". A double quote that is not closed is an error, and there is no escape for a quote inside a word.
  • A blank line runs nothing.
  • What the command says goes to the bottom bar, until the next key: Scripts reloaded. after :scripting.reload, for example.
  • One line is open at a time: : on an open line types a :.

Every command that Tilde knows runs from the line, the same ones that the keys run:

  • q, quit and app.quit quit tt.
  • The commands of the screen, such as index.next, tree.expand or message.open. They are listed in tt commands and contexts.
  • search.run <text> searches the list, as / does: see Search.
  • scripting.reload reads the scripts and keybind.lua again, so a key changed in the file works without a restart.
  • A command that a Lua script adds with commands.add: see Commands.

A command is the same whether a key, the line or a script runs it. A key bound in keybind.lua to index.next and the line :index.next do the same thing.

While the line is open, the keys are those of the context writing. The keys below are bound there, and Tab, which does nothing on the line. Every other key is typed into the line, the digits too, so a count does not work on the line.

Keys What they do
Enter run the line
Esc close the line and run nothing
Left, Right move the cursor one character
Home, Ctrl-a go to the start of the line
End, Ctrl-e go to the end of the line
Backspace remove the character before the cursor
Delete remove the character at the cursor
Ctrl-w remove the word before the cursor
Ctrl-u remove everything before the cursor

The context writing does not fall back to global, so ZZ and : are typed as text here. Ctrl-c still quits.

Enter runs the command text.submit. A keybind.lua written before the command line existed does not bind it. Add these lines to keybind.lua and run tt again:

keys.bind("global", ":", "commandline.start")
keys.bind("writing", "<CR>", "text.submit")

When keybind.lua fails, Tilde still binds :, and Enter and Esc on the line, if the file left them free, so the line can always be closed.

The line has no history and no completion yet.