charmbracelet / charmbracelet/vhs
Impossible to escape / in Wait regex
Open
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 20.9k
- Forks
- 480
- Avg merge
- 4d 1h
- Merged PRs (30d)
- 2
Description
Describe the bug
Using Wait+Screen /foo\\/bar/ or something vhs fails with
22 │ Wait+Screen /foo\\\/bar/
^^^^^^ Invalid regular expression 'foo\\\': error parsing regexp: trailing backslash at end of expression: ``
22 │ Wait+Screen /foo\\\/bar/
^^^^ Invalid command: bar/
Or similar using a single-escape:
22 │ Wait+Screen /foo\/bar/
^^^^ Invalid regular expression 'foo\': error parsing regexp: trailing backslash at end of expression: ``
22 │ Wait+Screen /foo\/bar/
^^^^ Invalid command: bar/
The only way to check it is using \x{2F} instead of /
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Wait+Screen regex example from the issue, comparing the single- and double-escaped slash forms with the \x{2F} workaround. Trace the Wait+Screen command entry point and its regular-expression parsing; done means an escaped / is accepted without the trailing-backslash or invalid-command errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100