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: Implement bell #2469

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

feat: Implement bell #2469

wants to merge 2 commits into from

Conversation

4513ECHO
Copy link

@4513ECHO 4513ECHO commented Apr 5, 2024

What kind of change does this PR introduce?

  • Feature

Implement bell sound on macOS and Windows.
Close #1967 (currently partial)

TODO

  • Implement bell on X11/Wayland
  • Implement visual bell
  • Should we implement neovide.bell rpc method for user?

Did this PR introduce a breaking change?

A breaking change includes anything that breaks backwards compatibility either at compile or run time.

  • No

@fredizzimo
Copy link
Member

Another option for the bell is to use a configurable external command like Alacritty:

That's probably the only easy way on X11/Wayland. On Windows and macOS it could still default to built-ins like you do here, but allow a command for more customization.

@4513ECHO
Copy link
Author

4513ECHO commented Apr 8, 2024

I've added g:neovide_bell_command option. I want to make its type Vec<String>, but I can't fix typing error...

@fredizzimo
Copy link
Member

I've added g:neovide_bell_command option. I want to make its type Vec<String>, but I can't fix typing error...

Sorry for not coming back to you earlier. Supporting vectors is indeed not supported by our settings system right now. But I think a single command is good enough. You can always call a shell script if you want a more complex command.

Copy link
Member

@fredizzimo fredizzimo left a comment

Choose a reason for hiding this comment

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

This needs rebasing on the latest master

}
RedrawEvent::VisualBell => {
tracy_zone!("EditorVisualBell");
// TODO: Implement visual bell
Copy link
Member

Choose a reason for hiding this comment

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

Do you need help implementing this?

let bell_command = bell_command.split(" ").collect::<Vec<_>>();
if bell_command.is_empty() {
unsafe {
// TODO: How to bell on X11/Wayland?
Copy link
Member

Choose a reason for hiding this comment

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

You can change this command to "Only custom commands are supported on X11 and Wayland"

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.

Is there any bell sound system?
2 participants