test-environments:
vim -Nu NONE -c 'set vb'
and input h, but expected visual-bell (flashing screen) doesn't happen.
Vim sends terminal-control-sequences at visualbell event when t_vb is ^[[?5h$<100/>^[[?5l:
expected: CSI ?5h (reverse video) → 100ms delay → CSI ?5l (normal video)
actual: 100ms delay → CSI ?5h (reverse video) → CSI ?5l (normal video)
At visualbell event, tputs() in out_str(T_VB) is called,
and out_char_nf() is called by every characters of T_VB except $<100/> (terminfo string).
$<100/> is interpreted and executed in tputs() in advance of calling out_char_nf().
in tputs():
[100ms delay by "$<100/>"]
out_char_nf('\e')
out_char_nf('[')
out_char_nf('?')
out_char_nf('5')
out_char_nf('h')
out_char_nf('\e')
out_char_nf('[')
out_char_nf('?')
out_char_nf('5')
out_char_nf('l')
T_VB has to be flushed, at least, before $<...>.
desirable sequence:
tputs("\e[?5h")
out_flush()
tputs("$<100/>\e[?5l")
This patch adds out_str_cf() to check $< in T_VB and to insert flushing.
Ozaki Kiichi
https://github.com/vim/vim/pull/1789
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
Merging #1789 into master will decrease coverage by
0.02%.
The diff coverage is0%.
@@ Coverage Diff @@ ## master #1789 +/- ## ========================================== - Coverage 75.08% 75.06% -0.03% ========================================== Files 76 76 Lines 125067 125085 +18 ========================================== - Hits 93907 93895 -12 - Misses 31160 31190 +30
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/term.c | 52.41% <0%> (-0.57%) |
⬇️ |
| src/misc1.c | 82.68% <0%> (ø) |
⬆️ |
| src/if_xcmdsrv.c | 85.18% <0%> (-0.93%) |
⬇️ |
| src/gui_gtk_x11.c | 47.39% <0%> (-0.11%) |
⬇️ |
| src/ex_cmds2.c | 79.6% <0%> (-0.11%) |
⬇️ |
| src/channel.c | 83.8% <0%> (-0.1%) |
⬇️ |
| src/evalfunc.c | 81.6% <0%> (-0.03%) |
⬇️ |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered by Codecov. Last update 4670490...9ae7892. Read the comment docs.
Sorry, I wrote an incorrect content of "cause". I have revised it.
I updated patch.
do_visualbell() to adjust the interval of visualbell flashingIt appears this doesn't work for me. I actually liked the tiny flash,
making it flash for 200 msec would be a problem. Especially when it
repeats.
I agree, but I think it would be better not to include specific process for visual-bell into out_str_cf() and better to add new function to control.
I'd like to make out_str_cf() purely handle terminal-strings.
I set 200msec intervals of visualbell. I felt 1sec intervals are less responsiveness of flashing to input (e.g. at key-repeat).
Thanks. I think we should apply the restriction of once per second also to the normal bell. I don't think anyone counts on lots of bells :-)
—
I don't think anyone counts on lots of bells :-)
I do actually, and it took me quite some time to figure out that this was the cause of this (reason for this is below). I am currently using a recompiled version of Vim (with a part of misc1.c commented out) but I would appreciate an option to adjust the half a second delay to, say, 0.
OK, but I think we should also limit the normal bell. I know terminals that turn it into a visual bell and then one has to wait for the flashing to finish.
That is a good reasoning, but even in that case, some other terminals do audible bells. VX Connectbot (Android) even uses vibrate.
In any case, the 200 ms delay for the visual bell could also be configurable. If the first two people who write to this issue are already disagreeing on the length of time, other people will want it differently, too.
In case anyone is interested in the reason why I sometimes hold down a key to hear the bell repeating: the bell sound I use is kind of soothing and repeating it adds rhythm to that. It lets me relax in between the programming work :-). Plus, it's always good to know that no programs are currently slowing down the computer.
The reason given in the comments for the one per second limit is that some systems or terminals stall while playing a beep, so repeating some action or motion by holding a key down can cause a hang while a key buffer-full of beeps play. I wonder if any such systems are still used or supported. With libcanberra repeating a sound just restarts it and sounds play asynchronously anyway.
Regards, John Little