MCPcopy
hub / github.com/claude-code-best/claude-code / getDisplayPath

Function getDisplayPath

src/utils/file.ts:155–170  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

153}
154
155export function getDisplayPath(filePath: string): string {
156 // Use relative path if file is in the current working directory
157 const { relativePath } = getAbsoluteAndRelativePaths(filePath)
158 if (relativePath && !relativePath.startsWith('..')) {
159 return relativePath
160 }
161
162 // Use tilde notation for files in home directory
163 const homeDir = homedir()
164 if (filePath.startsWith(homeDir + sep)) {
165 return '~' + filePath.slice(homeDir.length)
166 }
167
168 // Otherwise return the absolute path
169 return filePath
170}
171
172/**
173 * Find files with the same name but different extensions in the same directory

Callers 15

renderToolUseMessageFunction · 0.85
getToolUseSummaryFunction · 0.85
renderToolUseMessageFunction · 0.85
renderToolUseMessageFunction · 0.85
getToolUseSummaryFunction · 0.85
AttachmentListFunction · 0.85
getToolUseSummaryFunction · 0.85
renderToolUseMessageFunction · 0.85
runAgentFunction · 0.85
renderToolResultMessageFunction · 0.85
getToolUseSummaryFunction · 0.85

Calls 1

Tested by

no test coverage detected