The prompt

Two lines

Shale's prompt takes two lines. The first is the heading: your user name, the machine's name, the directory you're in, the Git branch when there is one, and the time. The second is where you type, after a dollar sign.

shale
ada :: build-box · ~/project = main · 14:05
$  

Your home directory is shortened to a tilde. The marker is a hash sign instead of a dollar sign when you're root.

Git state

Inside a Git working tree, the heading shows the current branch. The sign before the branch says whether you have changes Git hasn't committed: an equals sign when the tree is clean, an asterisk when it isn't.

shale
ada :: build-box · ~/project * main · 14:05
$  

Shale asks Git in the background, so a slow repository never holds up the prompt. Until Git answers, the branch appears with no sign in front of it. In a detached checkout the heading shows the commit's short hash where the branch would be.

When a command fails

A command that exits with a status other than 0 gets a result line under its output: a cross, the status and how long it ran. A command that succeeds and took a second or more gets a check mark and its time, so you can see how long a build took without timing it.

shale
~/project $ grep plumber README.md

✗ exited 1 · 0s

~/project $ sleep 1

✓ 1s

A command stopped by a signal says which one, such as ✗ signal 15 when something terminates it. When Shale can't start the program at all, for example because no program has that name, the line says ✗ could not run.

The dollar sign on the next prompt is red after a failure and green after a success:

shale
ada :: build-box · ~/project = main · 14:05
$  

To see the last outcome again later, type ,last. It prints the program's name, how it ended and exactly how long it ran.

The short prompt

When you press Enter, the prompt you typed at stays in your scrollback, heading and all, so you can scroll back and see where each command ran and on which branch.

If you'd rather keep your scrollback compact, turn on the short prompt with transient-prompt: #t in your configuration. Then each prompt shrinks to one short line when you press Enter: the directory's name, a dollar sign and your command. The transcripts in this manual show the short prompt, to keep them compact.

~/.config/shale/config.sgl
(config transient-prompt: #t)
shale
~/src $ ls
main.sgl
util.sgl

~/src $ cd ..

~/project $ pwd
/home/ada/project

The short prompt shows only the last part of the directory's path. Under your home directory it adds a tilde in front, so ~/project/src becomes ~/src, and your home directory itself is a tilde alone. A command that spans several lines keeps its line breaks, with each extra line indented by two spaces.