Skip to content

Commit a4c2489

Browse files
authored
panache-git: fix bugs showing modified files and non-home dirs (#1188)
This PR fixes two bugs in the panache-git prompt: First, modified file counts were not being properly shown after updating to Nushell v0.109, which contained a breaking change in `split column`: https://www.nushell.sh/blog/2025-11-29-nushell_v0_109_0.html#switch-split-column-to-0-index-like-other-commands-toc panache-git relied on the old default column names when splitting columns to count modified files. This has been fixed with explicit column names so that the default names no longer matter. Second, when the current working directory was outside the home directory, panache-git would throw an error. The code was attempting to join path strings that didn't exist, and the `str join` in question turned out to be unnecessary, so it was removed, avoiding the error.
1 parent 485a62c commit a4c2489

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/prompt/panache-git.nu

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export def current-dir [] {
2929
let current_dir = ($env.PWD)
3030

3131
let current_dir_relative_to_home = (
32-
do --ignore-errors { $current_dir | path relative-to $nu.home-path | str join }
32+
do --ignore-errors { $current_dir | path relative-to $nu.home-path }
3333
)
3434

3535
let in_sub_dir_of_home = ($current_dir_relative_to_home | is-not-empty)
@@ -159,8 +159,8 @@ export def repo-structured [] {
159159
let staging_worktree_table = (if $has_staging_or_worktree_changes {
160160
$status
161161
| where ($it | str starts-with '1') or ($it | str starts-with '2')
162-
| split column ' '
163-
| get column2
162+
| split column ' ' col1 sw
163+
| get sw
164164
| split column '' staging worktree --collapse-empty
165165
} else {
166166
[[]]

0 commit comments

Comments
 (0)