implement status is-breakpoint

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 commit is contained in:
Kurtis Rader
2017-06-19 21:05:34 -07:00
parent d234a1870b
commit bd299e96b2
15 changed files with 85 additions and 33 deletions

View File

@@ -6,6 +6,7 @@ status
status is-login
status is-interactive
status is-block
status is-breakpoint
status is-command-substitution
status is-no-job-control
status is-full-job-control
@@ -27,6 +28,8 @@ The following operations (sub-commands) are available:
- `is-block` returns 0 if fish is currently executing a block of code. Also `-b` or `--is-block`.
- `is-breakpoint` returns 0 if fish is currently showing a prompt in the context of a `breakpoint` command. See also the `fish_breakpoint_prompt` function.
- `is-interactive` returns 0 if fish is interactive - that is, connected to a keyboard. Also `-i` or `--is-interactive`.
- `is-login` returns 0 if fish is a login shell - that is, if fish should perform login tasks such as setting up the PATH. Also `-l` or `--is-login`.