mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 09:39:52 +08:00
9e922a6e02
The `status` command currently silently allows incompatible flags (i.e., subcommands). Too, using flags to specify subcommands misleads the user into thinking they can specify multiple subcommands. We recently modified the `history` command to deprecate using flags for subcommands. This change does the same for the `status` command. Fixes #3509
52 lines
2.3 KiB
Plaintext
52 lines
2.3 KiB
Plaintext
\section status status - query fish runtime information
|
|
|
|
\subsection status-synopsis Synopsis
|
|
\fish{synopsis}
|
|
status
|
|
status is-login
|
|
status is-interactive
|
|
status is-block
|
|
status is-command-substitution
|
|
status is-no-job-control
|
|
status is-full-job-control
|
|
status is-interactive-job-control
|
|
status current-filename
|
|
status current-line-number
|
|
status print-stack-trace
|
|
status job-control CONTROL-TYPE
|
|
\endfish
|
|
|
|
\subsection status-description Description
|
|
|
|
With no arguments, `status` displays a summary of the current login and job control status of the shell.
|
|
|
|
The following operations (sub-commands) are available:
|
|
|
|
- `is-command-sub` returns 0 if fish is currently executing a command substitution. Also `-c` or `--is-command-substitution`.
|
|
|
|
- `is-block` returns 0 if fish is currently executing a block of code. Also `-b` or `--is-block`.
|
|
|
|
- `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`.
|
|
|
|
- `is-full-job-control` returns 0 if full job control is enabled. Also `--is-full-job-control` (no short flag).
|
|
|
|
- `is-interactive-job-control` returns 0 if interactive job control is enabled. Also, `--is-interactive-job-control` (no short flag).
|
|
|
|
- `is-no-job-control` returns 0 if no job control is enabled. Also `--is-no-job-control` (no short flag).
|
|
|
|
- `current-filename` prints the filename of the currently running script. Also `-f` or `--current-filename`.
|
|
|
|
- `current-line-number` prints the line number of the currently running script. Also `-n` or `--current-line-number`.
|
|
|
|
- `job-control CONTROL-TYPE` sets the job control type, which can be `none`, `full`, or `interactive`. Also `-j CONTROL-TYPE` or `--job-control=CONTROL-TYPE`.
|
|
|
|
- `print-stack-trace` prints a stack trace of all function calls on the call stack. Also `-t` or `--print-stack-trace`.
|
|
|
|
\subsection status-notes Notes
|
|
|
|
For backwards compatibility each subcommand can also be specified as a long or short option. For example, rather than `status is-login` you can type `status --is-login`. The flag forms are deprecated and may be removed in a future release (but not before fish 3.0).
|
|
|
|
You can only specify one subcommand per invocation even if you use the flag form of the subcommand.
|