Skip to content

First steps

This walks you from a freshly installed brush to one that’s highlighting your input and has a startup file of its own.

  1. Start brush from your current shell.

    brush

    If you were using Bash, you should land at a prompt that looks like the one you already had. That’s deliberate: started this way, brush is a non-login shell (see which files are read) and reads ~/.bashrc, then ~/.brushrc, which you’ll create in a moment. So your aliases, functions, exports and PS1 all come with you.

  2. Try a few things. Ordinary Bash works as-is:

    echo "Hello from brush!"
    ls -la | grep '\.conf'
    for i in 1 2 3; do echo "$i"; done

    History suggestions are enabled from the start: start retyping one of the commands above and the rest of it appears in dim text ahead of the cursor. Press the right arrow to accept it. By default brush keeps its history in ~/.brush_history, so suggestions start from the commands you run in brush.

  3. Turn on syntax highlighting. It’s off by default. To try it for one session, type exit and run brush --enable-highlighting. To keep it, create ~/.config/brush/config.toml (on Windows, %APPDATA%\brush\config.toml):

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

    Then type exit to get back to your previous shell, and start brush again. Now your input is colorized as you type, and a command that can’t be found turns red once you’ve typed a space after it.

  4. Give brush its own prompt. ~/.brushrc is read only by brush, after ~/.bashrc:

    ~/.brushrc
    # Make it obvious which shell this is.
    PS1='brush\$ '

    Type exit and start brush again; you should get the new prompt, while Bash keeps the old one.

The ~/.brushrc prompt applies only to a non-login brush, which is what you’ve been running. A login shell (brush -l) reads different files; see which files are read.

Last updated:

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