Skip to content

create-video: Strip control characters from directory name input#6900

Merged
JonnyBurger merged 2 commits intoremotion-dev:mainfrom
bskang-v6x:fix/create-video-strip-control-chars
Mar 23, 2026
Merged

create-video: Strip control characters from directory name input#6900
JonnyBurger merged 2 commits intoremotion-dev:mainfrom
bskang-v6x:fix/create-video-strip-control-chars

Conversation

@bskang-v6x
Copy link
Copy Markdown
Contributor

Summary

  • Strip C0 control characters (U+0000–U+001F) and DEL (U+007F) from directory name input
  • Fixes the issue where Ctrl+U in some terminal emulators injects U+0015 (NAK) into the input, causing the project to be created in a phantom directory like ^UDownloads/my-video

Closes #6859

Test plan

  • Enter a directory name normally → works as before
  • Paste a string containing control characters (e.g. \x15Downloads/my-video) → control chars are stripped, project created at Downloads/my-video

🤖 Generated with Claude Code

Terminal emulators can inject control characters via readline shortcuts
(e.g. Ctrl+U inserts U+0015 NAK). These invisible characters cause the
project to be created in a phantom directory like `^UDownloads/my-video`
instead of `Downloads/my-video`.

Strip all C0 control characters (U+0000–U+001F) and DEL (U+007F) from
the user's input before using it as a path.

Closes remotion-dev#6859

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@pullfrog
Copy link
Copy Markdown
Contributor

pullfrog bot commented Mar 23, 2026

Reviewed PR #6900. The fix is solid — the regex /[\x00-\x1f\x7f]/g correctly strips C0 control chars and DEL, and the .trim() call handles any edge cases cleanly.

One minor gap: options.directoryArgument (line 61) bypasses the stripping. A CLI argument like --dir $'\x15Downloads/my-video' would not get the same treatment. assertValidName still catches control chars in the basename itself, so it's not a runtime breakage — just an inconsistency worth addressing in a follow-up.

No blocking issues. LGTM with that optional suggestion.

Pullfrog  | View workflow run | Triggered by Pullfrogpullfrog.com𝕏

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Mar 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
bugs Ready Ready Preview, Comment Mar 23, 2026 10:06am
remotion Ready Ready Preview, Comment Mar 23, 2026 10:06am

Request Review

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JonnyBurger
Copy link
Copy Markdown
Member

LGTM too, thanks a lot!

@JonnyBurger JonnyBurger merged commit 6f59fc5 into remotion-dev:main Mar 23, 2026
17 checks passed
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.

create-video inserts U+0015 (NAK) control character in output directory path

2 participants