Implement focus tracking for terminals#7673
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7673 +/- ##
==========================================
- Coverage 88.64% 88.54% -0.11%
==========================================
Files 148 148
Lines 164279 162146 -2133
==========================================
- Hits 145627 143571 -2056
+ Misses 18652 18575 -77
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
Sry I had a compiler warning, but I fixed it already and rebased. Tests should pass now. |
|
Thanks, I'll include it now. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
|
Thanks a lot for this! ♥ It does not seem to work in tmux out of the box, however, because Is that intentional? Should we perhaps document it somewhere that tmux users are supposed to set |
|
I can't reproduce, for me it works ootb in tmux.
See here for my tmux config. I don't have anything with t_fe and it
works for me:
https://gitlab.com/vimpostor/dotfiles/-/blob/master/tmux/.tmux.conf
Am Wed, Jan 20, 2021 at 10:08:52AM -0800 schrieb Tomáš Janoušek:
…Thanks a lot for this! ♥
It does not seem to work in tmux out of the box, however, because `find_builtin_term("tmux-256color")` returns the end marker, not the xterm entry, so `t_fe` and `t_fd` stay empty. It's a bit confusing as 681fc3f#diff-de432db93b351dd11d91c892d506b5ba9de1c98ef632d358c8590a312ed5a18aR2058 suggests it might work in tmux.
Is that intentional? Should we perhaps document it somewhere that tmux users are supposed to set `t_fe` and `t_fd` (and also `t_BE`, `t_BD`, `t_PS` and `t_PE`, btw)?
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#7673 (comment)
|
|
I think it might be the line |
|
@vimpostor Oh, that's because you have |
|
Well I don't know if there is a better way to detect terminals that do support such sequences. I believe there are many other tools that check for xterm-256color to enable such features, but if you know a better way let me know. |
|
I'm not sure if there are better ways to detect this, but I have found something: tmux checks the XT terminfo capability and enables bracketed paste and focus reporting if it's present: XT is documented here: Unfortunately XT is not present in tmux terminfo entry so this doesn't help us at all. Personally, instead of overriding tmux to pretend it's xterm-256color, I use a custom terminfo: https://github.com/liskin/dotfiles/blob/8e1e8d9c3c5e0bfad62dccef78c4f524f9c49489/.terminfo/terminfo.src, so adding XT would be easy (that is, assuming it doesn't break anything else…), but that doesn't help anyone else so it's useless. So unfortunately I don't know of anything that is clearly better. :-/ |
…guioptions
Problem: MS-Windows: No color in shell when using "!" in 'guioptions.
Solution: Don't stop termcap when using a terminal window for the shell.
(vim-jp, closes vim/vim#4117)
vim/vim@049ca59
N/A patches for version.c:
vim-patch:8.2.2345: no focus events in a terminal
Problem: No focus events in a terminal.
Solution: Add the t_fd and t_fe termcap entries and implement detecting
focus events. (Hayaki Saito, Magnus Groß, closes vim/vim#7673,
closes vim/vim#609, closes vim/vim#5526)
vim/vim@681fc3f
vim-patch:8.2.2564: focus events end Insert mode if 'esckeys' is not set
Problem: Focus events end Insert mode if 'esckeys' is not set.
Solution: Do not enable focus events when 'esckeys' is off. (closes vim/vim#7926)
vim/vim@51b477f
…guioptions
Problem: MS-Windows: No color in shell when using "!" in 'guioptions.
Solution: Don't stop termcap when using a terminal window for the shell.
(vim-jp, closes vim/vim#4117)
vim/vim@049ca59
N/A patches for version.c:
vim-patch:8.2.0890: no color in terminal window when 'termguicolor' is set
Problem: No color in terminal window when 'termguicolor' is set.
Solution: Clear the underline color. (closes vim/vim#6186)
vim/vim@1e5f8f6
vim-patch:8.2.1805: Unix: terminal mode changed when using ":shell"
Problem: Unix: terminal mode changed when using ":shell".
Solution: Avoid calling settmode() when not needed. (issue vim/vim#7079)
vim/vim@80361a5
vim-patch:8.2.2345: no focus events in a terminal
Problem: No focus events in a terminal.
Solution: Add the t_fd and t_fe termcap entries and implement detecting
focus events. (Hayaki Saito, Magnus Groß, closes vim/vim#7673,
closes vim/vim#609, closes vim/vim#5526)
vim/vim@681fc3f
vim-patch:8.2.2564: focus events end Insert mode if 'esckeys' is not set
Problem: Focus events end Insert mode if 'esckeys' is not set.
Solution: Do not enable focus events when 'esckeys' is off. (closes vim/vim#7926)
vim/vim@51b477f
This implements focus tracking for terminals supporting this sequence. See https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-FocusIn_FocusOut for the specification.
This is largely based on the initial patch by saitoha on the mailing list 5 years ago.