2019-03-31 09:05:09 +00:00
.. _cmd-fish_breakpoint_prompt:
2019-02-25 00:11:07 +00:00
fish_breakpoint_prompt - define the prompt when stopped at a breakpoint
=======================================================================
2018-12-17 01:39:33 +00:00
2018-12-18 01:58:24 +00:00
Synopsis
--------
2018-12-16 21:08:41 +00:00
2019-03-29 19:55:28 +00:00
::
2019-02-25 00:11:07 +00:00
function fish_breakpoint_prompt
...
end
2018-12-18 01:58:24 +00:00
2018-12-16 21:08:41 +00:00
2018-12-19 02:44:30 +00:00
Description
2019-01-03 04:10:47 +00:00
-----------
2018-12-16 21:08:41 +00:00
2018-12-19 20:02:45 +00:00
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.
2018-12-16 21:08:41 +00:00
2019-03-30 19:44:07 +00:00
The exit status of commands within `` fish_breakpoint_prompt `` will not modify the value of `$status <index.html#variables-status> `__ outside of the `` fish_breakpoint_prompt `` function.
2018-12-16 21:08:41 +00:00
2018-12-19 20:02:45 +00:00
`` fish `` ships with a default version of this function that displays the function name and line number of the current execution context.
2018-12-16 21:08:41 +00:00
2018-12-19 02:44:30 +00:00
Example
2019-01-03 04:10:47 +00:00
-------
2018-12-16 21:08:41 +00:00
2019-02-25 00:11:07 +00:00
A simple prompt that is a simplified version of the default debugging prompt::
2018-12-19 03:14:04 +00:00
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