-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Visual bells do not work #72
Comments
Has there been any movement on this in the past year? |
Nope. |
+1 |
@andreas-wilm Please don't comment "+1" on issues without providing valuable, additional information. It creates unnecessary email noise for everyone following the issue. There's a perfectly good +1 button you can use to express the same sentiment without pinging everyone on the thread. |
Apologies. You're absolutely right of course. Last time I make noise here |
My terminfo entry (on Ubuntu, for xterm-256color) contains this entry:
where I guess that strace'ing bash reveals that on visual bell it does a
that is, switches to global reverse mode and then immediately back to normal. I don't know if MS Terminal supports global reverse mode, but even if it does, if an app immediately reverts it then it makes perfect sense that the display is actually never reversed. So I'd argue there's a bug in bash to begin with, by omitting the delay. (I haven't checked vim.) (And on a side note, I'd argue that this escape sequence is broken by design. A visual bell cannot reliably be shown over an ssh or such, since due to timing differences the length of the flash varies a lot, including easily not being shown at all. Instead, IMO, it would be a better approach if applications kept emitting |
For the record, I've just submitted PR #3817, which mostly fixes this issue. Executing Personally I'm in agreement with @egmontkob that that is a bug in bash, and not something we should be trying to fix. But I'll leave that call for the MS devs to make. |
## Summary of the Pull Request This adds support for the [`DECSCNM`](https://vt100.net/docs/vt510-rm/DECSCNM.html) private mode escape sequence, which toggles the display between normal and reverse screen modes. When reversed, the background and foreground colors are switched. Tested manually, with [Vttest](https://invisible-island.net/vttest/), and with some new unit tests. ## References This also fixes issue #72 for the most part, although if you toggle the mode too fast, there is no discernible flash. ## PR Checklist * [x] Closes #3773 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [x] Tests added/passed * [ ] Requires documentation to be updated * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx ## Detailed Description of the Pull Request / Additional comments I've implemented this as a new flag in the `Settings` class, along with updates to the `LookupForegroundColor` and `LookupBackgroundColor` methods, to switch the returned foreground and background colors when that flag is set. It also required a new private API in the `ConGetSet` interface to toggle the setting. And that API is then called from the `AdaptDispatch` class when the screen mode escape sequence is received. The last thing needed was to add a step to the `HardReset` method, to reset the mode back to normal, which is one of the `RIS` requirements. Note that this does currently work in the Windows Terminal, but once #2661 is implemented that may no longer be the case. It might become necessary to let the mode change sequences pass through conpty, and handle the color reversing on the client side. ## Validation Steps Performed I've added a state machine test to make sure the escape sequence is dispatched correctly, and a screen buffer test to confirm that the mode change does alter the interpretation of colors as expected. I've also confirmed that the various "light background" tests in Vttest now display correctly, and that the `tput flash` command (in a bash shell) does actually cause the screen to flash.
You know, the fundamental support for this was added in #3817, even to conhost, so I'm gonna close this one out as fixed. |
From @yoctozepto on November 16, 2017 11:6
As mentioned in #715 - visual bells do not work - the terminal does not blink.
How to reproduce?
Enable visual bells either in bash:
set bell-style visible
in
~/.inputrc
or vim:
set visualbell
in
~/.vimrc
and execute any action triggering a bell (e.g. walking past the buffer).
The terminal should blink but it does not.
Extra info
Sound bells do work (the beeping) when enabled (by default).
This functionality is useful for people disabling sounds and still hoping to get some feedback that they are doing something wrong. :-)
Copied from original issue: microsoft/WSL#2678
The text was updated successfully, but these errors were encountered: