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

Function tildify

src/utils/deepLink/banner.ts:118–123  ·  view source on GitHub ↗

* Shorten home-dir-prefixed paths to ~ notation for the banner. * Not using getDisplayPath() because cwd is the current working directory, * so the relative-path branch would collapse it to the empty string.

(p: string)

Source from the content-addressed store, hash-verified

116 * so the relative-path branch would collapse it to the empty string.
117 */
118function tildify(p: string): string {
119 const home = homedir()
120 if (p === home) return '~'
121 if (p.startsWith(home + sep)) return '~' + p.slice(home.length)
122 return p
123}

Callers 1

buildDeepLinkBannerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected