Skip to content

gtk: some bell features need to happen on receipt of every BEL - #8962

Merged
mitchellh merged 1 commit into
ghostty-org:mainfrom
jcollie:gtk-bell-every-time
Sep 30, 2025
Merged

mitchellh merged 1 commit into
ghostty-org:mainfrom
jcollie:gtk-bell-every-time

Conversation

@jcollie

@jcollie jcollie commented Sep 30, 2025

Copy link
Copy Markdown
Member

Some bell features should be triggered on the receipt of every BEL character, namely audio and system. However, Ghostty was setting a boolean to true upon the receipt of the first BEL. Subsequent BEL characters would be ignored until that boolean was reset to false, usually by keyboard/mouse activity.

This PR fixes the problem by ensuring that the audio and system features are triggered every time a BEL is received. Other features continue to be triggered only when the bell-ringing boolean state changes.

Fixes #8957

@jcollie
jcollie requested a review from a team as a code owner September 30, 2025 00:24

@pluiedev pluiedev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Makes quite a lot of sense

Some bell features should be triggered on the receipt of every BEL
character, namely `audio` and `system`. However, Ghostty was setting a
boolean to `true` upon the receipt of the first BEL. Subsequent BEL
characters would be ignored until that boolean was reset to `false`,
usually by keyboard/mouse activity.

This PR fixes the problem by ensuring that the `audio` and `system`
features are triggered every time a BEL is received. Other features
continue to be triggered only when the `bell-ringing` boolean state
changes.

Fixes ghostty-org#8957
@mitchellh

Copy link
Copy Markdown
Contributor

This was totally good, I made some minor changes:

  • Added a lot more comments to make it clear this behavior is expected
  • Added a bell signal that is emitted on every bell. We don't use this yet, but it lets embedders have a mechanism for that (whereas the bell-ringing property notification is only on state change).
  • Added a freeze/thaw so that emitted signals don't cause duplicate changes

@mitchellh
mitchellh merged commit 4493860 into ghostty-org:main Sep 30, 2025
46 checks passed
@github-actions github-actions Bot added this to the 1.2.1 milestone Sep 30, 2025
@jcollie
jcollie deleted the gtk-bell-every-time branch September 30, 2025 13:59
mitchellh added a commit that referenced this pull request Oct 6, 2025
Some bell features should be triggered on the receipt of every BEL
character, namely `audio` and `system`. However, Ghostty was setting a
boolean to `true` upon the receipt of the first BEL. Subsequent BEL
characters would be ignored until that boolean was reset to `false`,
usually by keyboard/mouse activity.

This PR fixes the problem by ensuring that the `audio` and `system`
features are triggered every time a BEL is received. Other features
continue to be triggered only when the `bell-ringing` boolean state
changes.

Fixes #8957
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.

Audible ping not working as expected

3 participants