New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Different prompt for breakpoint #1310
Comments
Seems like a good idea! |
I like the idea of the prompt changing to the line number when paused! |
This sounds good to me too. |
This probably won't happen for 2.3.0, retargeting. |
Adding a
Do we want to add a |
I found another bug. The |
I think |
I'm leaning towards using |
On the other hand using a custom right prompt and leaving the left prompt the user's standard prompt may not make the fact we're in the debugger sufficiently clear. Nonetheless, I'm going to implement it as a right prompt replacement. We can easily change it to be a left prompt replacement if user feedback suggests that is necessary. |
I've tested using the breakpoint prompt as an alternative right prompt. This is probably not viable because the length of the debug prompt is likely to be long enough that the entire right prompt gets suppressed. Even if we only display the function name and line number. It's practically certain to be suppressed if we include the filename -- even if just limited to a fraction of the pathname. I tested this on a terminal 90 chars in width with a moderately long left prompt. So the debug prompt will have to be an alternative for the left prompt. If people want to include components of their left prompt in the debug prompt they will have to define their own |
Note that we need a way to get the context in which a |
This implements `status is-breakpoint` that returns true if the current shell prompt is displayed in the context of a `breakpoint` command. This also fixes several bugs. Most notably making `breakpoint` a no-op if the shell isn't interactive. Also, typing `breakpoint` at an interactive prompt should be an error rather than creating a new nested debugging context. Partial fix for #1310
This is another step to resolving issue #1310. It makes `fish_breakpoint_prompt` a replacement for `fish_prompt` if it is defined and we're presenting a prompt in the context of a `breakpoint` command.
As part of addressing #1310 I decided it makes more sense to replace `current-function` with just `function`, etc., because I'm going to add flags to let the user specify which stack level they are interested in. With the default being zero or the "current" level.
For those keeping track I have merged changes which will result in a distinct fish prompt when asking for user input in the context of a breakpoint. The information in that prompt will be incorrect because we currently do not have a way to get the correct information from within a prompt function. While imperfect this is a huge improvement over the previous situation which presented the user with a prompt that was extremely misleading. |
Another step to fixing #1310. This changes means that `status -L0 function` reports the correct function when inside a breakpoint.
Closing this issue since I've fixed it. The user now sees a very distinctive prompt when a There is more work to be done to make |
Although it's closed for 2 years, the documention states otherwise: https://fishshell.com/docs/current/index.html#debugging
|
@hellow554 right, fixed in 5ce4cb6 |
I like to be able to have prompt for a stopping at a
breakpoint
be different than the default. Like showing function/line number, for instance.If there is a way to detect that you are in a "breakpoint reached" mode either through the
status
builtin or some other method would be great :)Right now it's hard to see the difference between the prompt being normal and one with a breakpoint's context available
The text was updated successfully, but these errors were encountered: