Skip to content

Fix lexer regex escaping - #678

Merged
raphamorim merged 2 commits into
mainfrom
fix-lexer-regex-escaping
Nov 18, 2025
Merged

raphamorim merged 2 commits into
mainfrom
fix-lexer-regex-escaping

Conversation

@raphamorim

@raphamorim raphamorim commented Nov 18, 2025 •

Copy link
Copy Markdown
Contributor
  • I have read CONTRIBUTING.md.
  • I have created a discussion that was approved by a maintainer (for new features).

desertwitch and others added 2 commits November 18, 2025 09:08
The previous implementation didn't correctly handle cases where
backslashes themselves were escaped. For example, `/foo\\/` should
end at the delimiter (since `\\` is an escaped backslash, not an
escaped delimiter), but the old code would incorrectly continue.

This commit fixes the issue by counting consecutive backslashes:
- Odd count = delimiter is escaped, continue reading
- Even count = delimiter is not escaped, end regex

Added test case for `/foo\\/` to verify correct behavior.

Co-authored-by: desertwitch <24509509+desertwitch@users.noreply.github.com>
@raphamorim
raphamorim requested a review from a team as a code owner November 18, 2025 08:12
@raphamorim
raphamorim requested review from andreynering and aymanbagabas and removed request for a team November 18, 2025 08:12
@raphamorim
raphamorim merged commit 9efc235 into main Nov 18, 2025
@raphamorim
raphamorim deleted the fix-lexer-regex-escaping branch November 18, 2025 15:44
jackspirou added a commit to agentstation/vhs that referenced this pull request Dec 3, 2025
Incorporates upstream changes:
- Dependency updates (go-version, crypto, runewidth, etc.)
- Lexer regex escaping fix (charmbracelet#678)
- CI/dependabot config syncs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request May 8, 2026
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [vhs](https://github.com/charmbracelet/vhs) | minor | `0.10.0` → `0.11.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>charmbracelet/vhs (vhs)</summary>

### [`v0.11.0`](https://github.com/charmbracelet/vhs/releases/tag/v0.11.0)

[Compare Source](charmbracelet/vhs@v0.10.0...v0.11.0)

### Scroll? More keys?

This release includes two nice features that include scrolling the viewport and supporting `Ctrl+<arrow>` keys. You can now use the `ScrollUp` and `ScrollDown` commands to scroll the viewport. VHS will also now recognize `Ctrl+Left/Up/Right/Down` keys.

Thanks to [@&#8203;joshka-oai](https://github.com/joshka-oai) and [@&#8203;sectore](https://github.com/sectore) for their gracious contributions and support 🙂

#### Changelog

##### New!

- [`bae3eb0`](charmbracelet/vhs@bae3eb0): feat: add viewport scroll commands to tapes ([#&#8203;707](charmbracelet/vhs#707)) ([@&#8203;joshka-oai](https://github.com/joshka-oai))
- [`9e27976`](charmbracelet/vhs@9e27976): feat: support `ctrl` + arrow keys ([#&#8203;673](charmbracelet/vhs#673)) ([@&#8203;sectore](https://github.com/sectore))

##### Fixed

- [`55f824a`](charmbracelet/vhs@55f824a): fix(docker): remove ubuntu font which is no longer available in alpine ([@&#8203;aymanbagabas](https://github.com/aymanbagabas))
- [`b8a1d86`](charmbracelet/vhs@b8a1d86): fix(docker): update env variables to use '=' ([@&#8203;aymanbagabas](https://github.com/aymanbagabas))
- [`9c80359`](charmbracelet/vhs@9c80359): fix: lint issues ([@&#8203;aymanbagabas](https://github.com/aymanbagabas))

##### Other stuff

- [`9efc235`](charmbracelet/vhs@9efc235): Fix lexer regex escaping ([#&#8203;678](charmbracelet/vhs#678)) ([@&#8203;raphamorim](https://github.com/raphamorim))
- [`0a14d2c`](charmbracelet/vhs@0a14d2c): ci: sync dependabot config ([#&#8203;660](charmbracelet/vhs#660)) ([@&#8203;charmcli](https://github.com/charmcli))
- [`0bb2251`](charmbracelet/vhs@0bb2251): ci: sync dependabot config ([#&#8203;668](charmbracelet/vhs#668)) ([@&#8203;charmcli](https://github.com/charmcli))
- [`a94d725`](charmbracelet/vhs@a94d725): ci: sync golangci-lint config ([@&#8203;caarlos0](https://github.com/caarlos0))
- [`be49219`](charmbracelet/vhs@be49219): ci: sync golangci-lint config ([#&#8203;650](charmbracelet/vhs#650)) ([@&#8203;github-actions](https://github.com/github-actions)\[bot])

***

<details>
<summary>Verifying the artifacts</summary>

First, download the [`checksums.txt` file](https://github.com/charmbracelet/vhs/releases/download/v0.11.0/checksums.txt) and the [`checksums.txt.sigstore.json` file](https://github.com/charmbracelet/vhs/releases/download/v0.11.0/checksums.txt.sigstore.json) files, for example, with `wget`:

```bash
wget 'https://github.com/charmbracelet/vhs/releases/download/v0.11.0/checksums.txt'
wget 'https://github.com/charmbracelet/vhs/releases/download/v0.11.0/checksums.txt.sigstore.json'
```

Then, verify it using [`cosign`](https://github.com/sigstore/cosign):

```bash
cosign verify-blob \
  --certificate-identity 'https://github.com/charmbracelet/meta/.github/workflows/goreleaser.yml@refs/heads/main' \
  --certificate-oidc-issuer 'https://token.actions.githubusercontent.com' \
  --bundle 'checksums.txt.sigstore.json' \
  ./checksums.txt
```

If the output is `Verified OK`, you can safely use it to verify the checksums of other artifacts you downloaded from the release using `sha256sum`:

```bash
sha256sum --ignore-missing -c checksums.txt
```

Done! You artifacts are now verified!

</details>

<a href="https://charm.land/"><img alt="The Charm logo" src="https://stuff.charm.sh/charm-banner-next.jpg" width="400"></a>

Thoughts? Questions? We love hearing from you. Feel free to reach out on [X](https://x.com/charmcli), [Discord](https://charm.land/discord), [Slack](https://charm.land/slack), [The Fediverse](https://mastodon.social/@&#8203;charmcli), [Bluesky](https://bsky.app/profile/charm.land).

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xNjguNSIsInVwZGF0ZWRJblZlciI6IjQzLjE2OC41IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiLCJhdXRvbWF0aW9uOmJvdC1hdXRob3JlZCIsImRlcGVuZGVuY3ktdHlwZTo6bWlub3IiXX0=-->
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.

3 participants

⌂ 换网址