Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions config/shared/starship.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ add_newline = true

format = '$directory$git_branch$git_commit$git_state$git_status$character'

right_format = '$status$cmd_duration$jobs$username$hostname$python$nodejs$java$aws$kubernetes'
right_format = '$status$cmd_duration$jobs($username$hostname )$python$nodejs$java$aws$kubernetes'

[directory]
format = '[$path]($style) '
format = '[$path]($style)[$read_only]($read_only_style) '
style = 'bold blue'
read_only = ' [ro]'
read_only_style = 'bold red'

truncation_length = 2
truncation_symbol = '.../'
Expand Down Expand Up @@ -65,16 +67,16 @@ show_always = false

[hostname]
ssh_only = true
format = '[@](bright-black)[$hostname]($style) '
format = '[@](bright-black)[$hostname]($style)'
style = 'bold yellow'

[aws]
format = '([aws:$profile]($style) )'
style = 'bold yellow'

[kubernetes]
disabled = false
format = '[k8s:$context]($style) '
disabled = true
format = '[k8s:$context(/$namespace)]($style) '
style = 'bold cyan'
detect_files = [
'Chart.yaml',
Expand All @@ -93,15 +95,17 @@ context_pattern = 'arn:aws:eks:[^:]+:[^:]+:cluster/(?P<cluster>[^/]+)'
context_alias = '$cluster'

[python]
format = '[($virtualenv )]($style)'
format = '([py:$version(\($virtualenv\))]($style) )'
version_format = '${major}.${minor}'
generic_venv_names = ['.venv', 'venv']
style = 'yellow'

[nodejs]
format = '[($version )]($style)'
version_format = 'v${major}'
format = '[(node:$version )]($style)'
version_format = '${major}'
style = 'green'

[java]
format = '[($version )]($style)'
version_format = 'v${major}'
format = '[(java:$version )]($style)'
version_format = '${major}'
style = 'yellow'
11 changes: 11 additions & 0 deletions docs/ENVIRONMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ Selfishell release and never happens during shell startup.
Mise manages the Starship executable and its version; Selfishell still manages
`starship.toml` and prompt initialization.

Directories that are not writable show a bold red `[ro]` immediately after the path.

The right prompt keeps short-lived command results before the more stable
environment context. Node and Java show their major version (`node:24`,
`java:21`). Python uses Starship's built-in module to show its major/minor
version (`py:3.13`) and, when active, the virtualenv (`py:3.13(myenv)`). Generic
`.venv` and `venv` names use their parent directory name. Python appears only
in detected Python directories or with an active virtualenv.
Kubernetes is disabled by default. If enabled, it uses file/folder detection
and includes the namespace when configured (`k8s:dev/payments`).

Preview without changing the machine:

```sh
Expand Down