fish-shell/sphinx_doc_src/cmds/fish_breakpoint_prompt.rst
Fabian Homborg 191b74df6f docs: Fix some sphinx errors
See #5696.

[ci skip]
2019-03-29 20:55:28 +01:00

36 lines
1.2 KiB
ReStructuredText

fish_breakpoint_prompt - define the prompt when stopped at a breakpoint
=======================================================================
Synopsis
--------
::
function fish_breakpoint_prompt
...
end
Description
-----------
By defining the ``fish_breakpoint_prompt`` function, the user can choose a custom prompt when asking for input in response to a ``breakpoint`` command. The ``fish_breakpoint_prompt`` function is executed when the prompt is to be shown, and the output is used as a prompt.
The exit status of commands within ``fish_breakpoint_prompt`` will not modify the value of <a href="index.html#variables-status">$status</a> outside of the ``fish_breakpoint_prompt`` function.
``fish`` ships with a default version of this function that displays the function name and line number of the current execution context.
Example
-------
A simple prompt that is a simplified version of the default debugging prompt::
function fish_breakpoint_prompt -d "Write out the debug prompt"
set -l function (status current-function)
set -l line (status current-line-number)
set -l prompt "$function:$line >"
echo -ns (set_color $fish_color_status) "BP $prompt" (set_color normal) ' '
end