Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: setting to control cursor blinking #324

Merged
merged 9 commits into from
Jun 9, 2023
Merged

Conversation

tr3mor
Copy link
Contributor

@tr3mor tr3mor commented Jun 9, 2023

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

README.md Outdated Show resolved Hide resolved
@maaslalani
Copy link
Contributor

Thank you so much! This looks perfect!

lexer_test.go Outdated
Comment on lines 39 to 41
{SET, "Set"},
{CURSOR_BLINK, "CursorBlink"},
{STRING, "false"},
Copy link
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
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.

Copy link
Contributor

@maaslalani maaslalani Jun 9, 2023

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
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
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!

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide 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>
parser.go Outdated Show resolved Hide resolved
parser.go Outdated Show resolved Hide resolved
token.go Outdated Show resolved Hide resolved
@maaslalani
Copy link
Contributor

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

lexer_test.go Outdated Show resolved Hide resolved
lexer_test.go Outdated Show resolved Hide resolved
parser.go Outdated Show resolved Hide resolved
token.go Outdated Show resolved Hide resolved
token.go Outdated Show resolved Hide 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