on main help sign in
fix(sidebar): fix full path appearing on sidebar on windows
commitdba44be045f1d3029705c6d6aa56ddeb4532fcab authorAndrey Nering <andreynering@users.noreply.github.com> dateMon 11 Aug 2025, 16:16 (1 year ago) parent705d6f6
1 file changed+4−1
internal/tui/components/files/files.go+4−1
internal/tui/components/files/files.go+4−1
@@ -3,6 +3,7 @@ package files
33import (
44 "fmt"
55 "os"
6+ "path/filepath"
67 "sort"
78 "strings"
89
@@ -91,7 +92,9 @@ func RenderFileList(fileSlice []SessionFile, opts RenderOptions) []string {
9192 extraContent := strings.Join(statusParts, " ")
9293 cwd := config.Get().WorkingDir() + string(os.PathSeparator)
9394 filePath := file.FilePath
94− filePath = strings.TrimPrefix(filePath, cwd)
95+ if rel, err := filepath.Rel(cwd, filePath); err == nil {
96+ filePath = rel
97+ }
9598 filePath = fsext.DirTrim(fsext.PrettyPath(filePath), 2)
9699 filePath = ansi.Truncate(filePath, opts.MaxWidth-lipgloss.Width(extraContent)-2, "…")
97100