charmbracelet / charmbracelet/vhs

Impossible to escape / in Wait regex

Open
#592 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.