mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-23 04:51:16 -03:00
Remove dunderscores from __fish_status_to_signal (#7597)
* Remove dunderscores from __fish_status_to_signal * Document fish_status_to_signal * CHANGELOG: Add fish_status_to_signal * Add string join to fish_status_to_signal documentation example
This commit is contained in:
29
doc_src/cmds/fish_status_to_signal.rst
Normal file
29
doc_src/cmds/fish_status_to_signal.rst
Normal file
@@ -0,0 +1,29 @@
|
||||
.. _cmd-fish_status_to_signal:
|
||||
|
||||
fish_status_to_signal - Convert exit codes to human-friendly signals
|
||||
====================================================================
|
||||
|
||||
Synopsis
|
||||
--------
|
||||
|
||||
::
|
||||
|
||||
function fish_prompt
|
||||
echo -n (fish_status_to_signal $pipestatus | string join '|') (prompt_pwd) '$ '
|
||||
end
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
``fish_status_to_signal`` converts exit codes to their corresponding human-friendly signals if one exists.
|
||||
This is likely to be useful for prompts in conjunction with the ``$status`` and ``$pipestatus`` variables.
|
||||
|
||||
Example
|
||||
-------
|
||||
|
||||
::
|
||||
|
||||
>_ sleep 5
|
||||
^C⏎
|
||||
>_ fish_status_to_signal $status
|
||||
SIGINT
|
||||
Reference in New Issue
Block a user