feat: add network namespace module (#6449)

This commit is contained in:
Max Niederman
2025-03-09 08:45:58 -07:00
committed by GitHub
parent d6ed4c6192
commit eb42f5ac70
8 changed files with 218 additions and 0 deletions
+33
View File
@@ -353,6 +353,7 @@ $time\
$status\
$os\
$container\
$netns\
$shell\
$character"""
```
@@ -3011,6 +3012,38 @@ format = '[$symbol]($style)'
style = 'bold purple'
```
## Network Namespace
The `netns` module shows the current network namespace.
This uses `ip netns identify` to get the network namespace, so only network namespaces mounted at `/var/run/netns` will be detected.
### Options
| Option | Default | Description |
| ---------- | ------------------------------- | ----------------------------------------------------------------- |
| `format` | `'[$symbol \[$name\]]($style)'` | The format for the module. |
| `symbol` | `'🛜 '` | The symbol used before the network namespace (defaults to empty). |
| `style` | `'blue bold dimmed'` | The style for the module. |
| `disabled` | `false` | Disables the `netns` module. |
### Variables
| Variable | Example | Description |
| -------- | ---------- | ----------------------------------------- |
| name | `my-netns` | The name of the current network namespace |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
### Example
```toml
# ~/.config/starship.toml
[netns]
style = 'bold yellow'
symbol = '🌐 '
```
## Nim
The `nim` module shows the currently installed version of [Nim](https://nim-lang.org/).