You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "evgenyponomarev (via GitHub)" <gi...@apache.org> on 2026/08/31 01:21:59 UTC
[PR] Closes #3825: fix(cli): statusline never abbreviates home-relative paths on Windows [maka]
evgenyponomarev opened a new pull request, #4298:
URL: https://github.com/apache/maka/pull/4298
Closes #3825.
Verified against the pinned tree: the patch applies cleanly and the issue's post-fix check passes.
**Scope:** this repository does not build as a whole in the sandbox that produced this, so the check ran over the packages this patch touches and their dependencies. The rest of the repository was not built or tested here - please treat CI as the first check over the whole tree.
Written by an AI coding agent (Sloppy) and opened under my account.
<!-- sloppy-mission-proof:slp_p_mVftFwOr5_TJWiIPZH__Sw -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org
Re: [PR] Closes #3825: fix(cli): statusline never abbreviates home-relative paths on Windows [maka]
Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han closed pull request #4298: Closes #3825: fix(cli): statusline never abbreviates home-relative paths on Windows
URL: https://github.com/apache/maka/pull/4298
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org
Re: [PR] Closes #3825: fix(cli): statusline never abbreviates home-relative paths on Windows [maka]
Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han commented on PR #4298:
URL: https://github.com/apache/maka/pull/4298#issuecomment-5497918948
Closing this one — #4481 landed a fix for #3825 earlier today, so the Windows home-relative path is already abbreviated on `main`. Nothing wrong with your change; it just arrived alongside two others aimed at the same issue and #4481 got there first.
Sorry for the wasted effort, and thanks for taking it on. If you pull `main` and still see a path that isn't abbreviated, please do reopen or file a follow-up — a case #4481 missed would be worth having.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org
Re: [PR] Closes #3825: fix(cli): statusline never abbreviates home-relative paths on Windows [maka]
Posted by "hqhq1025 (via GitHub)" <gi...@apache.org>.
hqhq1025 commented on code in PR #4298:
URL: https://github.com/apache/maka/pull/4298#discussion_r3891188467
##########
packages/cli/src/pi-transcript.ts:
##########
@@ -1922,10 +1922,14 @@ function firstLinePreview(text: string): string {
* `/Users/alice/workspace/project` → `~/workspace/project`.
* Falls back to the original path if it is not under the home directory.
*/
-function shortenCwd(cwd: string, homeDir?: string): string {
+export function shortenCwd(cwd: string, homeDir?: string): string {
const home = homeDir ?? homedir();
- if (home && cwd.startsWith(home + '/')) return `~${cwd.slice(home.length)}`;
- if (home && cwd === home) return '~';
+ const normalizedHome = home.replace(/\\/g, '/');
Review Comment:
[P2] Preserve platform path semantics when checking containment. Replacing every backslash before comparison is unsafe for both supported path families. On this exact commit, `shortenCwd('C:\\Users\\Alice\\work', 'c:\\users\\alice')` returns the full absolute path even though Windows treats it as inside the home directory. Conversely, `shortenCwd('/home/alice\\sibling/project', '/home/alice')` returns `~\\sibling/project`, although on POSIX the backslash is an ordinary filename character and that path is a sibling, not a descendant. This therefore still misses valid Windows paths and introduces a false home-relative display on POSIX. Please make containment platform-aware (including Windows case handling) and add regressions for both cases.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org