Moth

Macros

Save a snippet or record a sequence of terminal input to use again.

Text snippets

In Settings → Macros, give a snippet a name, enter its text and optionally assign a shortcut. Tick Press Enter if you want it to run immediately, then choose Apply Macro to save it. You can run it from the Macros menu in whichever pane is active.

[macros."Project directory"]
text = "cd ~/Projects"
submit = false
shortcut = ""

This example inserts a directory change without running it. Snippets use bracketed paste when the application enables it, and Press Enter sends Return afterwards. A macro can contain either text or recorded keys.

Record and replay

Choose Macros → Start Recording, type in the terminal, then choose Macros → Stop Recording… and give it a name. The recording includes what you type and paste, terminal keys such as arrows and Return, and the pauses between them. Terminal-generated replies aren’t recorded, and the recording stays with the pane where you started it.

Macros → Stop Playback cancels any input that hasn’t been sent yet. Playback follows the recorded timing; it doesn’t wait for prompts or reconnect a lost session. Hidden input is recorded too, so don’t record passwords or tokens.

Storage and limits

Macros are saved in [macros."Name"] tables with text, submit, shortcut, keys and delays fields. You can keep up to 64 macros, with 32 KB available for their names, text and key data combined. A text snippet can be up to 8 KB.

A recording can contain 512 events and up to 16 KB of input. Each pause is limited to five seconds, with a maximum of 120 seconds across the recording. Moth rejects reserved or conflicting macro shortcuts. You can rename macros, delete them and edit their shortcuts in Settings; recorded key data is read-only.