Skip to content

fix(media-use): escape control characters in the adopt skip line - #8087

Merged
michaelwang11394 merged 1 commit into
mainfrom
fix-adopt-escape-names
Nov 17, 2026
Merged

michaelwang11394 merged 1 commit into
mainfrom
fix-adopt-escape-names

Conversation

@michaelwang11394

Copy link
Copy Markdown
Contributor

Summary

media-use resolve --adopt skips empty media files under assets/ and prints a line naming each one. That line used the file and folder names from the project as they are. A project could name a file with escape sequences, carriage returns or newlines. Those would then rewrite or hide terminal lines, forge new ones, or set the window title. The line is printed on stderr, so this also happened with --json.

The skip line now goes through terminalText(), the same helper the rest of media-use's output uses. Control characters show as visible \xNN escapes, and the line stays one line.

Testing

  • New case in adopt.test.mjs: an empty .mp3 whose name holds an OSC title sequence, CR and LF, inside a folder whose name holds a CSI sequence. The test checks the exact single line printed. It fails without the change.
  • node packages/cli/src/media-use/lib/adopt.test.mjs: 11 passed.

scanExistingAssets printed the project's own file and folder names to
stderr as they are. A name holding escape sequences could rewrite or
hide terminal lines. The line now goes through terminalText, like the
rest of media-use's output.

@eddy-heygen eddy-heygen left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Eddy's agent) Reviewed by Eddy's Claude agent at commit 1f2bd81.

Verdict: approved, good to ship.

Summary. When adopting existing assets, the line that reports a skipped empty file printed the file name from the project as it is. The line now goes through the same terminal-text helper the other media-use output uses, so control characters in a file or folder name are shown as visible escapes. I read the whole change (one import, one line, one test that covers both a folder name and a file name).

Blockers

None.

Non-blockers

None.

CI: all checks pass at this commit (the rest are skipped by path).

How this was reviewed: I read the full diff myself. Nothing was built or run.

@michaelwang11394
michaelwang11394 added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit 2749aaf Nov 17, 2026
69 checks passed
@michaelwang11394
michaelwang11394 deleted the fix-adopt-escape-names branch November 17, 2026 17:40
ukimsanov added a commit that referenced this pull request Nov 18, 2026
…d cube-validate lines

#8013 escaped resolve's results, recipes, stats and error lines, and
#8087 the adopt skip line. A few resolve lines still printed their
values raw: argument errors that repeat --type, --provider, --from,
--reuse and the --for path, the measured-grade note and the
similar-asset hint that repeats the intent. cube-validate's error can
quote a value from the LUT file. They now go through the same
terminalText copy, so a control character shows as \xNN. --json output
is unchanged.
imaderaya pushed a commit to pub-forks/hyperframes that referenced this pull request Nov 18, 2026
…d cube-validate lines (heygen-com#8059)

heygen-com#8013 escaped resolve's results, recipes, stats and error lines, and
heygen-com#8087 the adopt skip line. A few resolve lines still printed their
values raw: argument errors that repeat --type, --provider, --from,
--reuse and the --for path, the measured-grade note and the
similar-asset hint that repeats the intent. cube-validate's error can
quote a value from the LUT file. They now go through the same
terminalText copy, so a control character shows as \xNN. --json output
is unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants