fork/fish-shell

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

Aaron GyesShorten more.c6166f8ce

master
631 B17 linesraw
1function fish_status_to_signal --description "Convert exit code to signal name"
2    __fish_make_completion_signals # Make sure signals are cached
3    for arg in $argv
4        if test $arg -gt 128
5            # Important: each element of $__kill_signals is a string like "10 USR1"
6            if set -l signal_names (string replace -r --filter '^'(math $arg-128)' ' SIG $__kill_signals)
7                # Some signals have multiple mnemonics. Pick the first one.
8                echo $signal_names[1]
9            else
10                echo $arg
11            end
12        else
13            echo $arg
14        end
15    end
16    return 0
17end