charmbracelet / charmbracelet/vhs

Support repeating `Ctrl` commands (i.e. `Ctrl+W@250ms 3`)

Open
#340 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
20.9k
Forks
474
Avg merge
4d 1h
Merged PRs (30d)
2

Description

Hi! I'm trying to use command `Ctrl+W@250ms 3` to delete three words, and I get a parsing error.

Stderr

```
19 │ Ctrl+W@250ms 3
^ Invalid command: @

19 │ Ctrl+W@250ms 3
^^^ Invalid command: 250

19 │ Ctrl+W@250ms 3
^^ Invalid command: ms

19 │ Ctrl+W@250ms 3
^ Invalid command: 3

parser: 4 error(s)
```


It seems that there is no feature to repeat `Ctrl` keys, so I'd like to request it.

Contributor guide

Open the contributing guide

Research direction

Start at the command parser path that reports the Invalid command errors for `Ctrl+W@250ms 3`, and inspect how Ctrl commands and numeric repeats are currently tokenized. Done means this syntax repeats the Ctrl key with the stated delay and count without parsing errors, with coverage for the example.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.