2019-03-31 17:05:09 +08:00
.. _cmd-fish_breakpoint_prompt:
2019-02-25 08:11:07 +08:00
fish_breakpoint_prompt - define the prompt when stopped at a breakpoint
=======================================================================
2018-12-17 09:39:33 +08:00
2018-12-18 09:58:24 +08:00
Synopsis
--------
2018-12-17 05:08:41 +08:00
2021-12-18 07:16:47 +08:00
**fish_breakpoint_prompt**
::
function fish_breakpoint_prompt
...
end
2018-12-18 09:58:24 +08:00
2018-12-17 05:08:41 +08:00
2018-12-19 10:44:30 +08:00
Description
2019-01-03 12:10:47 +08:00
-----------
2018-12-17 05:08:41 +08:00
2020-09-18 22:51:14 +08:00
`` fish_breakpoint_prompt `` is the prompt function when asking for input in response to a :ref: `breakpoint <cmd-breakpoint>` command.
2018-12-17 05:08:41 +08:00
2020-01-31 11:38:56 +08:00
The exit status of commands within `` fish_breakpoint_prompt `` will not modify the value of :ref: `$status <variables-status>` outside of the `` fish_breakpoint_prompt `` function.
2018-12-17 05:08:41 +08:00
2018-12-20 04:02:45 +08: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-17 05:08:41 +08:00
2018-12-19 10:44:30 +08:00
Example
2019-01-03 12:10:47 +08:00
-------
2018-12-17 05:08:41 +08:00
2019-02-25 08:11:07 +08:00
A simple prompt that is a simplified version of the default debugging prompt::
2018-12-19 11:14:04 +08: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