Commit 1fe89111463d

Vincent Demeester <vincent@sbr.pm>
2026-02-18 10:39:11
fix(pi): fix dotfile path abbreviation in footer
Fixed abbreviatePath to preserve dot prefix for hidden dirs (.local โ†’ .l instead of .). Also aligned behavior with zsh prompt: keep last 2 path segments intact and only shorten when path exceeds 50 chars.
1 parent 57d2ef5
Changed files (1)
dots
pi
agent
dots/pi/agent/extensions/custom-footer.ts
@@ -25,8 +25,10 @@ import path from "node:path";
 
 /**
  * Abbreviate path to ~/s/h format (first letter of each directory)
+ * Dotfiles preserve the dot prefix (.local โ†’ .l).
  * ~/src/home -> ~/s/home
  * ~/src/tektoncd/pipeline -> ~/s/t/pipeline
+ * ~/.local/share/worktrees/foo -> ~/.l/s/w/foo
  */
 function abbreviatePath(fullPath: string): string {
 	const home = process.env.HOME || "";
@@ -50,6 +52,10 @@ function abbreviatePath(fullPath: string): string {
 		if (i === 0 || i === parts.length - 1) {
 			return part;
 		}
+		// Keep dot prefix for hidden dirs (.local โ†’ .l)
+		if (part.startsWith(".")) {
+			return "." + part[1];
+		}
 		// Abbreviate middle parts to first letter
 		return part[0];
 	});