Moth

Configuration and profiles

Change preferences in Settings or TOML, and save profiles for different windows.

The configuration file

You can change preferences in Settings or edit the file directly. Choose Moth → Edit Configuration… or use the button at the bottom of Settings to open:

~/.config/moth/config.toml

Save the file to apply your changes to open windows. Their shells keep running. If there’s an error, Moth keeps your last working settings and explains the problem in the status area and Moth → Configuration Error…. Shell and starting-directory changes take effect when you open a new session.

Changes made through Settings preserve your comments and any keys Moth doesn’t recognise.

The annotated example configuration lists the settings with comments explaining what they do.

Root keys and sections

In TOML, a section header applies to everything below it until the next header. Put settings that don’t belong to a section at the top of the file:

theme = "system"
fontName = "WumpusMonoPro-Regular"
fontSize = 14.0
scrollback = 10000
alternateScreenScrollback = true
closeOnExit = true
shell = "/bin/zsh"
optionAsMeta = false
textEncoding = "UTF-8"

[cursor]
shape = "block"
animation = "breathe"
period = 1.4

Font sizes run from 9 to 32 points, and scrollback can hold up to 100,000 rows. Saving the file reloads it automatically; ⌘⌥R reloads it manually. Zooming the font in a window is temporary.

Option follows the macOS keyboard layout by default, and Option+Left/Right move between shell words. Enable Option-as-Meta in Settings only when you want Option combinations sent as terminal Meta commands.

Named profiles

Use Settings → Profiles to save your current appearance and session defaults under a name. The Editing profile selector tells you which profile you’re changing.

A profile keeps its colours, typography, background, window decoration, cursor, sounds and shell defaults together. It also includes the starting directory, environment, history limit, Option-as-Meta behaviour, text encoding and what happens when a session exits. Shortcuts, macros, close confirmations, logging and clipboard permissions, and the list of enabled encodings are shared across profiles.

Window → New Window with Profile opens a window using a particular profile. Window → Window Profile changes an existing window without restarting its shells. New tabs and splits inherit the window’s profile. You can choose the default for ⌘N in Settings → Profiles.

Profile files live in ~/.config/moth/Profiles/<UUID>.toml and reload when you save them. Invalid edits leave the last working settings in place. Renaming a profile keeps its identifier; deleting one makes a backup and leaves existing windows as they were. Saved window layouts remember the profile’s identifier.

Directory inheritance is a session default stored with each profile. Session recovery is shared across profiles.

Reset preferences

Settings → Advanced → Reset All Preferences… restores the defaults after asking for confirmation. It backs up your current file as config.toml.before-reset-<timestamp>-<id> and archives the Profiles folder, so you can recover your choices later.

This also works if the current file has errors. Your saved layouts and running shell sessions are kept.