Skip to content

Configure brush

brush reads three kinds of configuration, and the useful question is which one a given setting belongs in.

Put it in When
~/.bashrc, ~/.bash_profile It should work in Bash too — aliases, functions, exports, PS1
~/.brushrc It’s shell script, but only makes sense in brush
config.toml It’s a brush setting rather than shell script

brush follows Bash’s rules, so a login shell and a non-login shell read different files:

Shell Reads, in order
Interactive, non-login (running brush) /etc/bash.bashrc~/.bashrc~/.brushrc
Login (brush -l) /etc/profile → the first of ~/.bash_profile, ~/.bash_login, ~/.profile

A login shell reads neither ~/.bashrc nor ~/.brushrc. If you want ~/.brushrc in a login brush too, add this line to the profile file you already use: [[ -n $BRUSH_VERSION && -r ~/.brushrc ]] && . ~/.brushrc. The BRUSH_VERSION check keeps Bash from reading it. The login-shell case matters on macOS even if you never log in at a console: Terminal.app and iTerm2 start whatever shell you configure as a login shell.

--rcfile FILE reads only that file, not ~/.brushrc; --norc and --noprofile skip the rc and profile files; --config FILE and --no-config are the equivalents for config.toml. See the command-line reference.

Read after ~/.bashrc, and only by brush, so it’s the place for anything you want to differ from Bash. Because it’s read last, a PS1 set here replaces the one from ~/.bashrc. First steps walks through creating it.

brush’s own settings — in ~/.config/brush/config.toml on Linux and macOS, and %APPDATA%\brush\config.toml on Windows:

~/.config/brush/config.toml
[ui]
syntax-highlighting = true

Syntax highlighting is off by default; this setting turns it on. The configuration file reference has every setting, the lookup path on each platform, and the JSON schema for editor completion; experimental features covers the [experimental] section. Terminal shell integration has its own how-to.

Last updated:

Open source under the MIT license. Built in the open by the brush community.