Commit 826fe1e
Changed files (3)
modules
modules/core/shell/default.nix
@@ -10,8 +10,8 @@
# multi-line right prompts are a local extension.
nixpkgs.overlays = [
(final: prev: {
- starship = prev.starship.overrideAttrs (old: {
- patches = (old.patches or []) ++ [./starship-flyline-rps1.patch];
+ starship = prev.starship.overrideAttrs (finalAttrs: prevAttrs: {
+ patches = (prevAttrs.patches or []) ++ [./starship-flyline-rps1.patch];
doCheck = false;
});
})
modules/core/shell/starship-flyline-rps1.patch
@@ -1,7 +1,8 @@
-diff --git a/src/context.rs b/src/context.rs
---- a/src/context.rs
-+++ b/src/context.rs
-@@ -63,6 +63,9 @@ pub struct Context<'a> {
+diff --git a/src/context/mod.rs b/src/context/mod.rs
+index 230e162..943d57b 100644
+--- a/src/context/mod.rs
++++ b/src/context/mod.rs
+@@ -73,6 +73,9 @@ pub struct Context<'a> {
/// Which prompt to print (main, right, ...)
pub target: Target,
@@ -11,15 +12,15 @@ diff --git a/src/context.rs b/src/context.rs
/// Width of terminal, or zero if width cannot be detected.
pub width: usize,
-@@ -178,6 +181,7 @@ impl<'a> Context<'a> {
- repo: OnceLock::new(),
+@@ -189,6 +192,7 @@ impl<'a> Context<'a> {
+ jj_repo: OnceLock::new(),
shell,
target,
+ multiline: false,
width,
env,
#[cfg(test)]
-@@ -207,6 +211,12 @@ impl<'a> Context<'a> {
+@@ -212,6 +216,12 @@ impl<'a> Context<'a> {
self
}
@@ -29,21 +30,18 @@ diff --git a/src/context.rs b/src/context.rs
+ self
+ }
+
- // Tries to retrieve home directory from a table in testing mode or else retrieves it from the os
- pub fn get_home(&self) -> Option<PathBuf> {
- home_dir(&self.env)
+ /// Sets the Claude Code session data
+ pub fn with_claude_code_data(mut self, data: ClaudeCodeData) -> Self {
+ self.claude_code_data = Some(Box::new(data));
diff --git a/src/init/starship.bash b/src/init/starship.bash
+index 0355c60..e2e838a 100644
--- a/src/init/starship.bash
+++ b/src/init/starship.bash
-@@ -78,9 +78,14 @@ starship_precmd() {
- STARSHIP_START_TIME=""
- fi
- PS1="$(::STARSHIP:: prompt "${ARGS[@]}")"
-+ local nlns=${PS1//[!$'\n']}
+@@ -82,7 +82,10 @@ starship_precmd() {
if [[ ${BLE_ATTACHED-} ]]; then
-- local nlns=${PS1//[!$'\n']}
bleopt prompt_rps1="$nlns$(::STARSHIP:: prompt --right "${ARGS[@]}")"
-+ elif [[ ${FLYLINE_VERSION-} ]]; then
+ elif [[ ${FLYLINE_VERSION-} ]]; then
+- RPS1="$nlns$(::STARSHIP:: prompt --right "${ARGS[@]}")"
+ local rps1 rnlns
+ rps1="$(::STARSHIP:: prompt --right --multiline "${ARGS[@]}")"
+ rnlns=${rps1//[!$'\n']}
@@ -52,6 +50,7 @@ diff --git a/src/init/starship.bash b/src/init/starship.bash
STARSHIP_PREEXEC_READY=true # Signal that we can safely restart the timer
}
diff --git a/src/main.rs b/src/main.rs
+index 204ee40..8d9e6a6 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -127,6 +127,9 @@ enum Commands {
@@ -82,6 +81,7 @@ diff --git a/src/main.rs b/src/main.rs
Commands::Module {
name,
diff --git a/src/print.rs b/src/print.rs
+index a173e71..5e41760 100644
--- a/src/print.rs
+++ b/src/print.rs
@@ -69,8 +69,8 @@ fn test_grapheme_aware_width() {
modules/core/shell/starship.toml
@@ -11,9 +11,10 @@ $character
right_format = """
$nix_shell\
+$vcs\
$time\
$line_break\
-[<](white)
+[ <](white)
"""
add_newline = false
@@ -53,9 +54,21 @@ heuristic = true
symbol = "nix"
format = "[$symbol\\[$name\\]]($style) "
+[vcs]
+disabled = false
+order = ["jj", "git"]
+jj_modules = "$jj_bookmark$jj_change$jj_metrics$jj_status"
+git_modules = "$git_branch$git_commit$git_state$git_metrics$git_status"
+
+[git_branch]
+format = "[$symbol$branch(:$remote_branch)]($style) "
+
+[jj_bookmark]
+format = "[$symbol$bookmark(@$remote)$diverged( \\(+$overflow_count others\\))]($style) "
+
[time]
disabled = false
-format = "[ $time]($style)"
+format = "[$time]($style)"
time_format = "%R"
utc_time_offset = "local"
style = "dimmed white"