- `char` - makes it possible to output newlines and tabs (sophiajt)
- `do` - runs a block to completion, optionally ignoring errors (sophiajt)
## Custom prompts (sophiajt)
You can now run a pipeline which returns a string, or list of strings, that is used to create a custom prompt. To do so, set the pipeline you want to use in the config for the `prompt` setting.
A simple example:
```
> config --set [prompt "echo '> '"]
```
We've also added a new `ansi` command to let you change the color. Let's use it to change the prompt to blue:
```
> config --set [prompt "echo $(ansi blue) '> '"]
```
You can make the prompt even fancier. For example, this prompt prints the current directory, git branch, and current date and time:
```
> config --set [prompt 'echo [ $(ansi green) $(pwd) $(ansi reset) $(do -i {git rev-parse --abbrev-ref HEAD } | trim | echo [ "(" $(ansi blue) $it $(ansi reset) ")" ] | str join) $(char newline) $(ansi cyan) $(date --format "%d/%m/%Y %H:%M:%S").formatted $(ansi reset) "> " ]']
```
_Example of full prompt_
Or update your prompt to show an abbreviated path:
```
> config --set [prompt 'echo [ $(ansi green) $(pwd | split row "/" | first $(pwd | split row "/" | count | = $it - 1 ) | each { str substring "0,1" | format "{$it}/" } | append $(pwd | split row "/" | last ) | str join) $(do -i { git rev-parse --abbrev-ref HEAD | trim | echo $(ansi reset) "(" $(ansi blue) $it $(ansi reset) ")" | str join }) $(ansi reset) "> "]']
```
(note: the above assumes Unix-based systems, so on Windows use "\" as the path separator))