mirror of
https://github.com/starship/starship.git
synced 2026-06-23 02:05:51 +07:00
feat: add docker context module (#996)
* feat: add docker context module Adds a simple module that checks for a Docker config file and if present, reads the `currentContext` value out and displays on the prompt with a whale. * feat: add `only_with_compose_yml` option to docker_context When enabled, will only show the docker context name if there's a docker-compose.yml file in the current directory. * Update src/modules/docker_context.rs Co-Authored-By: Thomas O'Donnell <andytom@users.noreply.github.com> * Update src/modules/docker_context.rs Co-Authored-By: Thomas O'Donnell <andytom@users.noreply.github.com> * rename `only_with_compose_yml` configuration key to a more generic `only_with_files` * Update src/modules/docker_context.rs Co-Authored-By: Thomas O'Donnell <andytom@users.noreply.github.com> * re-order configuration table * Update docs/config/README.md Co-Authored-By: Thomas O'Donnell <andytom@users.noreply.github.com> * Update src/configs/docker_context.rs Co-Authored-By: Thomas O'Donnell <andytom@users.noreply.github.com> Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
This commit is contained in:
@@ -100,6 +100,7 @@ prompt_order = [
|
||||
"git_state",
|
||||
"git_status",
|
||||
"hg_branch",
|
||||
"docker_context",
|
||||
"package",
|
||||
"dotnet",
|
||||
"elixir",
|
||||
@@ -405,6 +406,30 @@ a single character. For `fish_style_pwd_dir_length = 2`, it would be `/bu/th/ci/
|
||||
truncation_length = 8
|
||||
```
|
||||
|
||||
## Docker Context
|
||||
|
||||
The `docker_context` module shows the currently active
|
||||
[Docker context](https://docs.docker.com/engine/context/working-with-contexts/) if it's not set to
|
||||
`default`.
|
||||
|
||||
### Options
|
||||
|
||||
| Variable | Default | Description |
|
||||
| ----------------- | ------------- | ---------------------------------------------------------------------------- |
|
||||
| `symbol` | `"🐳 "` | The symbol used before displaying the Docker context . |
|
||||
| `only_with_files` | `false` | Only show when there's a `docker-compose.yml` or `Dockerfile` in the current directory. |
|
||||
| `style` | `"bold blue"` | The style for the module. |
|
||||
| `disabled` | `true` | Disables the `docker_context` module. |
|
||||
|
||||
### Example
|
||||
|
||||
```toml
|
||||
# ~/.config/starship.toml
|
||||
|
||||
[docker_context]
|
||||
symbol = "🐋 "
|
||||
```
|
||||
|
||||
## Dotnet
|
||||
|
||||
The `dotnet` module shows the relevant version of the .NET Core SDK for the current directory. If
|
||||
|
||||
Reference in New Issue
Block a user