Repository navigation
fix(cwd): fish style keeps emoji and UNC roots, and (s)egments applies in fish mode - #803
Merged
Merged
Conversation
Fish style shortens each middle directory to its first character, but it took that character with part[0] (and part[1] after a leading dot), which index UTF-16 code units. A folder whose name starts with an emoji or other character outside the Basic Multilingual Plane was cut in half, leaving a lone surrogate that the terminal prints as U+FFFD: "~/🚀 rockets/sub/last" showed as "~/�/s/last". A decomposed accented name such as "Über" lost its combining mark, and a joined emoji such as "👨👩👧" printed as U+FFFD too. Take the first grapheme instead, using the getGraphemes helper the symbol editors already use, so the abbreviation keeps one whole user-visible character, including after the dot of a hidden directory.
Fish style splits the path on separators, drops the empty pieces and then rebuilds it, putting a single separator back only when the path started with '/'. A Windows UNC path lost its leading '\\' entirely, so "\\server\share\team\repo" showed as the relative-looking "server\s\t\repo", and "//server/share/team/repo" kept only one of its two slashes. Keep the path's leading separators as they were and join the shortened parts after them. POSIX paths keep their '/', home and drive-letter paths have no leading separators and come out as before.
Fish style and the segment count are mutually exclusive: turning fish style on clears the segment count, and turning on the home ~ option turns fish style off. The (s)egments editor broke that rule. It is offered while fish style is on, but on Enter it kept fish style and stored the count next to it. Fish style wins when both are set, so the item still read "(fish-style)" and the preview and status line didn't change, as if the edit had been dropped. The hidden count then cut the path the moment fish style was turned off. Saving a segment count now turns fish style off, the same way the home ~ option does, so the count takes effect as soon as it is entered and the item shows it. A blank entry still only clears the count. Settings saved before this fix, or edited by hand, can still hold both. Turning fish style off now drops the segment count as well, so the full path comes back instead of a count that was never shown. Since turning fish style on already clears the count, it can only sit next to fish style through the old editor or a hand edit.
# Conflicts: # src/tui/components/__tests__/ItemsEditor.test.ts # src/widgets/__tests__/CurrentWorkingDir.test.ts
# Conflicts: # src/widgets/__tests__/CurrentWorkingDir.test.ts
This was referenced Nov 7, 2026
Closed
Closed
pcvelz
added a commit
to pcvelz/ccstatusline-usage
that referenced
this pull request
Nov 13, 2026
Upstream: Extra Usage Today widget (sirmalloc#811), newer usage API percent in an idle session (sirmalloc#767), thinking-effort brackets and per-level colors (sirmalloc#777), 256-color grid in Edit Colors (sirmalloc#778), context bar thin line mode (sirmalloc#794), progress-bar widget consolidation (sirmalloc#810), Zed IDE link mode (sirmalloc#800), Check for Updates deadline and proxy fixes (sirmalloc#806), Configure Status Line before an install (sirmalloc#807), emoji and grapheme fixes (sirmalloc#808, sirmalloc#803, sirmalloc#790), Nerd Font icon width in Ghostty and kitty (sirmalloc#801), cache temp file leak fix (sirmalloc#783), plus TUI, timer and separator fixes. Hand edits outside conflicts: - src/tui/components/__tests__/InstallMenu.test.tsx: fork-rename (ccstatusline@ -> ccstatusline-usage@) - src/utils/__tests__/hooks.test.ts: fork-rename (ccstatusline@ -> ccstatusline-usage@) - src/tui/__tests__/App.test.ts: fork-rename; upstream's new menu and preview tests step over the fork's Off Hours row and pin cyan where the fork's Model default is ansi256:124 - src/tui/components/__tests__/ColorMenuPalette.test.tsx: fork deviation - Model default is ansi256:124 - src/utils/__tests__/global-package-manager.test.ts: fork deviation - fixture path uses the fork package name ccstatusline-usage - src/utils/__tests__/migrations.test.ts: fork deviation - flexMode is a post-v1 key in the fork, the v1 sample uses globalBold - src/utils/__tests__/usage-prefetch.test.ts: fork deviation - stub the provider gate (resolveProvider) in upstream's idle-session and daily-spend tests; the fork reads weekly usage from the API only - src/utils/__tests__/update-checker.test.ts: lint import order - src/utils/usage-prefetch.ts: lint - drop the unused fetchUsageData import - src/widgets/WeeklyFableUsage.ts: compat fix - render through upstream's formatUsageBar (sirmalloc#810) so the line mode works; the inverted cursor follows the shared percent-widget rule - src/widgets/__tests__/line-bar.test.ts: compat fix - fork WeeklyFableUsageWidget, weeklyFableUsage field and Fable label; block metrics stubbed so the inactive-block case does not read the real cache - src/widgets/shared/__tests__/usage-display.test.ts: compat fix - the merged cycle has line mode after slider-only - src/widgets/__tests__/ThinkingEffort.test.ts: keeps the fork's real-settings-file harness, ports upstream's sirmalloc#777 cases onto it - bun.lock: upstream dependency updates, re-resolved by bun install - docs/test-retirements.md: ledger for 7 tests upstream replaced (sirmalloc#781 tab as one space, sirmalloc#805 settings write failures, sirmalloc#800 Zed IDE link mode), each naming its replacing test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Three fixes to Current Working Dir's fish style:
�). This also covers emoji right after a hidden folder's dot. A decomposed accented letter keeps its accent.\\server\share\team\reposhows as\\server\s\t\repoinstead ofserver\s\t\repo, and//server/share/team/repokeeps both slashes.Why (evidence)
abbreviatePathshortened each middle folder withpart[0], or'.' + part[1]for hidden folders. Both index UTF-16 code units, so a character outside the Basic Multilingual Plane was cut in half. With fish style on, a cwd of$HOME/🚀 rockets/sub/lastprintedcwd: ~/+EF BF BD+/s/lastunder both Bun and Node (built dist): the lone surrogate reaches stdout as U+FFFD..😀xbecame.�, a decomposedÜberbecameU, and a joined family emoji became�.The same function splits on
/[\\/]+/, drops the empty pieces, and puts a separator back only when the path starts with/. So a path starting with\\lost its root entirely, and one starting with//kept one slash:\\server\share\team\repobecameserver\s\t\repo\\wsl.localhost\Ubuntu\home\me\projectbecamewsl.localhost\U\h\m\project//server/share/team/repobecame/server/s/t/repodocs/WINDOWS.md promises full support for UNC paths. Segments mode never makes a UNC path look relative: it shows the path whole, or cut to
...\team\repo.Fish style and the segment count are meant to be exclusive: turning fish style on clears the count, and turning on (h)ome ~ turns fish style off. The segments editor kept both. With fish style on, pressing s, typing 2 and pressing Enter left the item at "(fish-style)" and the preview at
~/D/P/my-project, while the settings now held{"fishStyle":"true","segments":"2"}. Pressing f later showed "(segments: 2)" and cut/srv/work/projects/alpha/betato.../alpha/beta. Turning fish style off removed onlyfishStyle, so the same happens with any settings file that already holds both.How
getGraphemeshelper that the glyph and Custom Symbol editors use.~) and drive-letter paths have no leading separators. POSIX paths keep their single/.fishStyle. A blank entry still only clears the count. (s)egments stays available in fish mode, like (h)ome ~, so whichever option was picked last applies right away.segmentsalong withfishStyle. Turning fish style on already clears the count, so the two can only sit together in settings saved by the old editor or edited by hand.Left as is:
//keeps both slashes, the same as a forward-slash UNC path (onmainit showed one).process.cwd()reports such a directory with one slash, but bash'spwdkeeps both aftercd //srv.Demo
Emoji and decomposed accents. Piped renders of Model + Current Working Dir with fish style on, before (
main) and after. The middle folders start with 🚀, with 🔒 after a hidden folder's dot, and with a decomposed Ü. A plain ASCII path is included as a control. The joined family emoji is left out because VHS's terminal draws the parts of a joined emoji separately; the unit test and the built-CLI check below cover it.Powerline
Before:
After:
Plain
Before:
After:
UNC paths. The same piped renders with
\\server\share,\\wsl.localhostand//server, with a drive-letter path as a control.Powerline
Before:
After:
Plain
Before:
After:
(s)egments while fish style is on. In the TUI: s, 2, Enter on a fish-style Current Working Dir. Before, nothing visible changes. After, the item reads "(segments: 2)" and the preview shows the last two folders.
Powerline
Before:
After:
Plain
Before:
After:
Fish style off, with a count already saved next to it. The settings hold
fishStyleandsegments: 2, as the old segments editor left them. The item reads "(fish-style)"; press f. Before, the hidden count takes over: "(segments: 2)" and.../Projects/my-project. After, the item has no modifier and the preview shows the full sample path.Powerline
Before:
After:
Plain
Before:
After:
Testing
On
mainas of fix(powerline): keep the Custom theme when Powerline is enabled again #793 (a0bedc0): it merges after one test conflict next to feat(widgets): add Zed as an IDE link mode #800's Zed case, resolved by keeping both.bun run lintis clean, andbun testgives 4156 pass, 0 fail (4147 onmain). The built CLI under Bun 1.4.4 and Node 26.13.0 agrees across runtimes and matchesmainin plain and Powerline mode, and the TUI opens and exits cleanly under both. It adds no JavaScript or Node API newer than Node 14, the build's target.9 new tests:
CurrentWorkingDir.test.ts: emoji, joined emoji, emoji after a dot, decomposed accentCurrentWorkingDir.test.ts:\\server,//server, and a drive-letter controlhandleEditorActioncase inCurrentWorkingDir.test.ts: turning fish style off with{fishStyle, segments}saved drops bothItemsEditor.test.tsthat presses s, 2, Enter on a fish-style Current Working DirRun against
main's code, the 8 non-control tests fail and the drive-letter control passes.Node 26.10.0 vitest on the two changed test files:
ItemsEditor.test.ts: 14/14 pass (main: 13/13).CurrentWorkingDir.test.ts: fails every test on bothmainand this branch, with the same error in its existingbeforeEach(vi.spyOn(os, 'homedir'): "Module namespace is not configurable in ESM"). That is 33 failures onmainand 41 here, all with that one error. With the spy line removed locally, the 8 new cases in that file pass under Node.Built CLI under Bun 1.4.2 and Node 26.10.0, piping 9 cwd values through a fish-style line. Both runtimes printed identical output:
~/🚀/s/last,~/.😀/s/last,/x/Ü/y,/a/👨👩👧/b,\\server\s\t\repo,\\wsl.localhost\U\h\m\projectand//server/s/t/repo. The drive-letter and POSIX controls (C:\U\m\p\sub,/srv/w/p/a/beta) matchmain.Built CLI under Bun and Node, in plain and Powerline modes:
main.mainas expected.