Preserve Unicode session log names (#988)#998
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1acc90635f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return fallback; | ||
| } | ||
|
|
||
| if (/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\..*)?$/i.test(safe)) { |
There was a problem hiding this comment.
Reject COM¹/LPT¹-style reserved names on Windows
safePathSegment only guards com[1-9]/lpt[1-9], but Windows also reserves superscript variants (e.g. COM¹, LPT²). Because this change now preserves Unicode characters, those labels pass through unchanged and later mkdir/file writes in startStream/autoSaveSessionLog can fail on Windows, dropping session logs for affected hosts.
Useful? React with 👍 / 👎.
| safe = `${safe}_`; | ||
| } | ||
|
|
||
| return safe; |
There was a problem hiding this comment.
Normalize trailing periods in sanitized path segments
The sanitizer now allows . within host directory names and does not strip trailing periods, so labels like prod. are returned as-is. Windows normalizes trailing periods on create/open, so prod and prod. can collapse to the same directory and mix logs, which is a regression from the previous ASCII-only replacement behavior.
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Fixes #988
Verification