diff --git a/config/shared/starship.toml b/config/shared/starship.toml index 23f74a19..eb718bd8 100644 --- a/config/shared/starship.toml +++ b/config/shared/starship.toml @@ -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 = '.../' @@ -65,7 +67,7 @@ show_always = false [hostname] ssh_only = true -format = '[@](bright-black)[$hostname]($style) ' +format = '[@](bright-black)[$hostname]($style)' style = 'bold yellow' [aws] @@ -73,8 +75,8 @@ 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', @@ -93,15 +95,17 @@ context_pattern = 'arn:aws:eks:[^:]+:[^:]+:cluster/(?P[^/]+)' 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' diff --git a/docs/ENVIRONMENT.md b/docs/ENVIRONMENT.md index 73ce45d6..331cc56b 100644 --- a/docs/ENVIRONMENT.md +++ b/docs/ENVIRONMENT.md @@ -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