Skip to content

feat: setting to control cursor blinking - #324

Merged
maaslalani merged 9 commits into
charmbracelet:mainfrom
tr3mor:main
Jun 9, 2023
Merged

maaslalani merged 9 commits into
charmbracelet:mainfrom
tr3mor:main

Conversation

@tr3mor

@tr3mor tr3mor commented Jun 9, 2023

Copy link
Copy Markdown
Contributor

Add support for setting CursorBlink to disable cursor blinking. Current behavior kept as default one.
Closes #319

Blinking disabled:

Output demo.gif
Require sleep

Set Shell "bash"
Set FontSize 32
Set Width 600
Set Height 300
Set CursorBlink false

Type "echo 'Welcome to VHS!'" Sleep 500ms  Enter
Sleep 5

not-blinking

Default behavior:

Output demo.gif
Require sleep

Set Shell "bash"
Set FontSize 16
Set Width 600
Set Height 300

Type "echo 'Welcome to VHS!'" Sleep 500ms  Enter
Sleep 5

blinking

Comment thread README.md Resolved
@maaslalani

Copy link
Copy Markdown
Contributor

Thank you so much! This looks perfect!

Comment thread lexer_test.go Outdated
Comment on lines +39 to +41
{SET, "Set"},
{CURSOR_BLINK, "CursorBlink"},
{STRING, "false"},

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think making it as STRING and parsing as bool later is fine, but if you think we need another type for bool (I believe this is the first one) let me know

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having a boolean type would be great for long term if possible.

@maaslalani maaslalani Jun 9, 2023 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bool type would also make parser errors much nicer.

We can leverage the parser errors stuff we already have:

Set CursorBlink fals
                ^^^^ expected boolean value

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, also updated parser to check for valid values

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet, this looks fantastic!

Comment thread README.md Resolved
Comment thread README.md Resolved
tr3mor and others added 4 commits June 9, 2023 21:21
Co-authored-by: Maas Lalani <maas@lalani.dev>
Co-authored-by: Maas Lalani <maas@lalani.dev>
Comment thread parser.go Resolved
Comment thread parser.go Resolved
Comment thread token.go Resolved
@maaslalani

Copy link
Copy Markdown
Contributor

Looking great! We can merge after the suggested changes are in.

Comment thread lexer_test.go Resolved
Comment thread lexer_test.go Resolved
Comment thread parser.go Resolved
Comment thread token.go Resolved
Comment thread token.go Resolved
@maaslalani
maaslalani merged commit 46cf42f into charmbracelet:main Jun 9, 2023
elmarsan pushed a commit to elmarsan/vhs that referenced this pull request Jun 14, 2023
* feat: setting to control cursor blinking

* feat: create bool type

* feat: parser updated

* readme wording

Co-authored-by: Maas Lalani <maas@lalani.dev>

* Update README.md

Co-authored-by: Maas Lalani <maas@lalani.dev>

* Update parser.go

* Update token.go

* Update parser.go

* Apply suggestions from code review

---------

Co-authored-by: Maas Lalani <maas@lalani.dev>
maaslalani added a commit that referenced this pull request Jun 14, 2023
* feat: add alt + shift modifiers

* style: fix lint issues

* Update parser.go

Co-authored-by: Maas Lalani <maas@lalani.dev>

* Theme test: fix ineffectual assignment

* test: add more test cases for suggestions

* feat: setting to control cursor blinking (#324)

* feat: setting to control cursor blinking

* feat: create bool type

* feat: parser updated

* readme wording

Co-authored-by: Maas Lalani <maas@lalani.dev>

* Update README.md

Co-authored-by: Maas Lalani <maas@lalani.dev>

* Update parser.go

* Update token.go

* Update parser.go

* Apply suggestions from code review

---------

Co-authored-by: Maas Lalani <maas@lalani.dev>

* docs: Set CursorBlink examples

* docs: fix CursorBlink example sizing

* feat(deps): bump github.com/go-rod/rod from 0.112.8 to 0.113.3 (#321)

Bumps [github.com/go-rod/rod](https://github.com/go-rod/rod) from 0.112.8 to 0.113.3.
- [Release notes](https://github.com/go-rod/rod/releases)
- [Commits](go-rod/rod@v0.112.8...v0.113.3)

---
updated-dependencies:
- dependency-name: github.com/go-rod/rod
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat(deps): bump github.com/mattn/go-isatty from 0.0.18 to 0.0.19 (#310)

Bumps [github.com/mattn/go-isatty](https://github.com/mattn/go-isatty) from 0.0.18 to 0.0.19.
- [Commits](mattn/go-isatty@v0.0.18...v0.0.19)

---
updated-dependencies:
- dependency-name: github.com/mattn/go-isatty
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* add note on TypingSpeed for new users in `demo.tape` (#327)

Added note to the comment that is generated when a user calls `vhs new` to call out that `TypingSpeed` can be customized globally, and defaults to 50ms

* docs: modify Ctrl keyword syntax

* docs: update readme

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Maas Lalani <maas@lalani.dev>
Co-authored-by: Andreas Deininger <andreas@deininger.net>
Co-authored-by: bashbunni <bunni@bashbunni.dev>
Co-authored-by: Pavel Storozhenko <storozhenkopf@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matt Johnston <m@ttjohnston.com>
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.

Can you please allow for disabling cursor blinking?

2 participants

⌂ 换网址