Feature Request: make "Current working dir" smarter & more flexible
Currently, it shows cwd: /full/path/that/can/be/very/long/
While this might be useful for some, it takes up a lot of space. I propose:
- Replace
cwd:with a NerdFonts folder icon - Show only the last 1 or 2 levels (configurable), prepended with
...
The configurable truncation you're after already exists. Here's how to set it up:
1. Launch the config tool:
npx -y ccstatusline@latest
or
bunx -y ccstatusline@latest
2. Open the editor for the status line containing the Current Working Dir widget, then move the highlight onto that widget.
3. Press s (segments), type 1 or 2, then Enter:
| Segments | Result |
|---|---|
| 1 | .../my-project |
| 2 | .../Projects/my-project |
4. (Optional) Press h to collapse your home folder to ~ → ~/.../my-project
5. (Optional) Press r (raw value) to drop the cwd: label entirely.
Combining segments + raw value gives something like .../my-project — short path, no cwd: prefix.
Follow-up: there's now a PR for the icon — #479 adds an optional folder glyph to this widget, off by default. Together with the existing segments and raw-value options, that should cover the request here.
Great, thanks for your quick reply! I wasn't aware that the menu had context-dependent options once you select a widget. Maybe you could find a way to make that pop out a bit more? That would increase the discoverability for new users.
Merged in #479 and it'll be published in the next release. The rest of the functionality is already built-in as @LegalBark has noted.