Errors and interrupts
In the terminalela --spec errors-and-interrupts
- Fail-fast applies to scripts only. Interactively, a failed command prints its exit code in red and returns to the prompt.
- Errors follow LANGUAGE.md, Error messages, without the
file:line:colplace: at the prompt, the error is about the line typed. An Errorfailraised and nothing caught is said as a script says it,ela:and its chain, and the prompt comes back. - A built-in's result dropped on its own line,
list.sort($xs), is no error when it is the line typed, and the prompt prints its value (A value at the prompt). - Ctrl-C interrupts the running command, or clears the line being typed, or drops the whole block being typed. It never exits the shell. While a line is typed the terminal is in raw mode and Ctrl-C is a key, not a signal; while a command runs, it reaches the command as SIGINT.
- Ctrl-Z stops the running command and gives the prompt back (Job control).
- Ctrl-D on an empty first line exits the shell. On an empty line in the middle of a block, it drops the block, as Ctrl-C does, and a fresh prompt follows. When the input ends in the middle of a block, the shell says what is missing and exits with 1.