mirror of
https://github.com/starship/starship.git
synced 2026-06-23 02:05:51 +07:00
feat(git_branch): add 'only_attached' config bool (#1910)
* feat(git_branch): add 'only_attached' config bool This adds a new boolean, `only_attached`, to the configuration for the `git_branch` module. This mirrors the `only_detached` config value for the `git_commit` module: setting the value to true causes the module to suppress its output when the user is not on a branch. This allows users to have either a branch name or a commit hash in their prompt, as opposed to having either a branch name or the overly-wordy "HEAD (sha1)". * Fix formatting
This commit is contained in:
@@ -1030,6 +1030,7 @@ The `git_branch` module shows the active branch of the repo in your current dire
|
||||
| `style` | `"bold purple"` | The style for the module. |
|
||||
| `truncation_length` | `2^63 - 1` | Truncates a git branch to X graphemes. |
|
||||
| `truncation_symbol` | `"…"` | The symbol used to indicate a branch name was truncated. You can use `""` for no symbol. |
|
||||
| `only_attached` | `false` | Only show the branch name when not in a detached HEAD state. |
|
||||
| `disabled` | `false` | Disables the `git_branch` module. |
|
||||
|
||||
### Variables
|
||||
|
||||
Reference in New Issue
Block a user