fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Nahorcolor: prefer `set_color --reset` over `set_color normal`867946468

master
959 B23 linesraw
1# Define the default debugging prompt command.
2function fish_breakpoint_prompt --description "A right prompt to be used when `breakpoint` is executed"
3    set -l saved_status $status
4    set -l function (status -L0 function)
5    set -l line (status -L0 line-number)
6    # At the moment we don't include the filename because, even if we truncate it, it makes the
7    # prompt too long.
8    #set -l filename (status filename)
9    #set -l prompt "$filename:$function:$line >"
10    set -l prompt "$function:$line"
11    if test $saved_status -ne 0
12        set prompt "$prompt [!$saved_status]"
13    end
14    set prompt "$prompt > "
15
16    # Make sure the prompt doesn't consume more than half the terminal width.
17    set -l max_len (math "$COLUMNS / 2")
18    if test (string length -- $prompt) -gt $max_len
19        set prompt ...(string sub -s -(math $max_len - 3) -- $prompt)
20    end
21
22    echo -ns (set_color $fish_color_status) "BP $prompt" (set_color --reset) ' '
23end