Skip to content

Instantly share code, notes, and snippets.

@taviso
Created Aug 29, 2019
Embed
What would you like to do?
UNIX signals as emoji
declare -ar _status=(
[ 0]=๐Ÿ˜€ # Success
[ 1]=๐Ÿคจ # Error
[129]=๐Ÿ“ž # SIGHUP
[130]=๐Ÿ›‘ # SIGINT
[131]="(โ•ฏยฐโ–กยฐ๏ผ‰โ•ฏ๏ธต โ”ปโ”โ”ป" # SIGQUIT
[132]=๐Ÿ‘ฎ # SIGILL
[133]=๐Ÿ # SIGTRAP
[134]=๐Ÿ’ฅ # SIGABRT
[135]=๐ŸšŒ # SIGBUS
[136]=๐Ÿงฎ # SIGFPE
[137]=๐Ÿ”ซ # SIGKILL
[138]=๐Ÿฅ‡ # SIGUSR1
[139]=๐Ÿ’ฃ # SIGSEGV
[140]=๐Ÿฅˆ # SIGUSR2
[141]=๐Ÿšฟ # SIGPIPE
[142]=โฐ # SIGALRM
[143]=๐Ÿ’€ # SIGTERM
[147]=๐Ÿ’ค # SIGSTOP
[148]=๐Ÿ˜ด # SIGTSTP
)
PS1='[${_status[$?]:-๐Ÿคท}:\u@\h \W]\$ '
@horazont

This comment has been minimized.

Copy link

@horazont horazont commented Aug 29, 2019

For ZSH:

typeset -A _status
_status=(
      0 ๐Ÿ˜€                # Success
      1 ๐Ÿคจ                # Error
    129 ๐Ÿ“ž                # SIGHUP
    130 ๐Ÿ›‘                # SIGINT
    131 "(โ•ฏยฐโ–กยฐ๏ผ‰โ•ฏ๏ธต โ”ปโ”โ”ป"  # SIGQUIT
    132 ๐Ÿ‘ฎ                # SIGILL
    133 ๐Ÿ                # SIGTRAP
    134 ๐Ÿ’ฅ                # SIGABRT
    135 ๐ŸšŒ                # SIGBUS
    136 ๐Ÿงฎ                # SIGFPE
    137 ๐Ÿ”ซ                # SIGKILL
    138 ๐Ÿฅ‡                # SIGUSR1
    139 ๐Ÿ’ฃ                # SIGSEGV
    140 ๐Ÿฅˆ                # SIGUSR2
    141 ๐Ÿšฟ                # SIGPIPE
    142 โฐ                # SIGALRM
    143 ๐Ÿ’€                # SIGTERM
    147 ๐Ÿ’ค                # SIGSTOP
    148 ๐Ÿ˜ด                # SIGTSTP
)
@taviso

This comment has been minimized.

Copy link
Owner Author

@taviso taviso commented Aug 29, 2019

๐Ÿ‘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment