[vim/vim] feat; add 'termsync' setting (PR #19541)

29 views
Skip to first unread message

Foxe Chen

unread,
Mar 1, 2026, 1:35:02β€―PMMar 1
to vim/vim, Subscribed

Same as Neovim's termsync option. Surprised this wasn't already added, consdering how simple it was to implement and it reduces flickering greatly for me on my machine.

Here's a before and after comparsion:

https://github.com/user-attachments/assets/fb45ab56-b3a8-491b-b589-3c818fa6cd25


You can view, comment on, or merge this pull request online at:

Β Β https://github.com/vim/vim/pull/19541

Commit Summary

File Changes

(10Β files)

Patch Links:

β€”
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541@github.com>

Foxe Chen

unread,
Mar 1, 2026, 1:48:01β€―PMMar 1
to vim/vim, Push

@64-bitman pushed 1 commit.

β€”
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/before/dcdfd82a50798bb2ecafa9dda9142dc1631b076f/after/18e4c8ed01bd905fa6d724457d37566141e3b848@github.com>

Foxe Chen

unread,
Mar 1, 2026, 3:51:06β€―PMMar 1
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/before/18e4c8ed01bd905fa6d724457d37566141e3b848/after/0e364c74a3ea5eb48b20a613d92ac984a333ba09@github.com>

Foxe Chen

unread,
Mar 1, 2026, 4:17:34β€―PMMar 1
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/before/0e364c74a3ea5eb48b20a613d92ac984a333ba09/after/befd2f04e2be32049945e5cc4ce64569597d9253@github.com>

Foxe Chen

unread,
Mar 1, 2026, 9:56:55β€―PMMar 1
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/before/befd2f04e2be32049945e5cc4ce64569597d9253/after/1401cf28920113a9a9e8f56c0b69b298446e63fb@github.com>

Foxe Chen

unread,
Mar 1, 2026, 9:58:24β€―PMMar 1
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/before/1401cf28920113a9a9e8f56c0b69b298446e63fb/after/00a08c7a34aad570484249a999ad8fffb6a3234e@github.com>

Foxe Chen

unread,
Mar 1, 2026, 10:06:01β€―PMMar 1
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/before/00a08c7a34aad570484249a999ad8fffb6a3234e/after/4525f76e2b897fd1b4a25d7041b00e578061e11b@github.com>

Foxe Chen

unread,
Mar 1, 2026, 10:32:02β€―PMMar 1
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/before/32d75e4b1df5f4ebcbfcab8f794486552765c62a/after/3a012f8f6687e9c9416b4746f47bb8ed1ed1eefc@github.com>

Foxe Chen

unread,
Mar 1, 2026, 11:23:45β€―PMMar 1
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/before/3a012f8f6687e9c9416b4746f47bb8ed1ed1eefc/after/ec005a070073b20cdc59505af505c97f60290a31@github.com>

Foxe Chen

unread,
Mar 1, 2026, 11:33:37β€―PMMar 1
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/before/ec005a070073b20cdc59505af505c97f60290a31/after/f2b8654159173752c04e8b183b497e1f92e33018@github.com>

Foxe Chen

unread,
Mar 1, 2026, 11:35:24β€―PMMar 1
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/before/f2b8654159173752c04e8b183b497e1f92e33018/after/56aa075fc50d62a9a831492252d453b8a521f039@github.com>

Foxe Chen

unread,
Mar 1, 2026, 11:37:07β€―PMMar 1
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/before/56aa075fc50d62a9a831492252d453b8a521f039/after/798f03b4981eddb33e275f99462b09b64f19ba05@github.com>

Foxe Chen

unread,
Mar 1, 2026, 11:50:40β€―PMMar 1
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/before/798f03b4981eddb33e275f99462b09b64f19ba05/after/af717ea22ee62554f8aaa11cb94c1771df0ce1d5@github.com>

Foxe Chen

unread,
Mar 1, 2026, 11:51:28β€―PMMar 1
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/before/af717ea22ee62554f8aaa11cb94c1771df0ce1d5/after/417d6778dbfaa41a04c4086f386c47aedb8773d5@github.com>

Foxe Chen

unread,
Mar 2, 2026, 12:04:06β€―AMMar 2
to vim/vim, Subscribed
64-bitman left a comment (vim/vim#19541)

I found #11718 which this PR is related to, seems like bram did not get the point of something like this. However it has noticeably reduces flickering for me, so I guess there is a point.

β€”
Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/c3982093080@github.com>

Foxe Chen

unread,
Mar 2, 2026, 9:09:25β€―AMMar 2
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/before/417d6778dbfaa41a04c4086f386c47aedb8773d5/after/ed465388a82fc9b905b951fb278f397eb4ac8569@github.com>

Foxe Chen

unread,
Mar 2, 2026, 9:20:02β€―AMMar 2
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/before/ed465388a82fc9b905b951fb278f397eb4ac8569/after/d5895058a5708c420da20ee130c6d184a020bb16@github.com>

Foxe Chen

unread,
Mar 2, 2026, 9:21:03β€―AMMar 2
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/before/d5895058a5708c420da20ee130c6d184a020bb16/after/af7f30f4faf631610dd6e6c23b0a2b708fad4ba7@github.com>

Christian Brabandt

unread,
Mar 2, 2026, 1:34:25β€―PMMar 2
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19541)

out_str((char_u *)"\033[?2026$p");

Hm, we typically have those as t_<letter> options. Don't we need this here as well instead of hard coding this?

β€”
Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/c3986144665@github.com>

Javier Jaramago FernΓ‘ndez

unread,
Mar 2, 2026, 3:13:53β€―PMMar 2
to vim/vim, Subscribed
JavierJF left a comment (vim/vim#19541)

This PR fixes the popup flickering, but does it as a side effect of the feature, also since it only does it for terminal that supports this feature, I think that having correctness back for popups without transparencies is important. So opaque popups don't require terminals with this feature to avoid rendering issues, while popups with transparencies will require it for avoiding flickering.

Due to this, I think that even with this PR, the with changes from #19534 are still required. Said this, I think it's a great feature to have πŸ‘ .

β€”
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/c3986670179@github.com>

Foxe Chen

unread,
Mar 2, 2026, 3:21:31β€―PMMar 2
to vim/vim, Subscribed
64-bitman left a comment (vim/vim#19541)

out_str((char_u *)"\033[?2026$p");

Hm, we typically have those as t_<letter> options. Don't we need this here as well instead of hard coding this?

Well it looks to me that all terminals that support synchronized output use this same escape sequence. However I think it is a good idea to add a t_ option for consistency

β€”
Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/c3986707537@github.com>

Foxe Chen

unread,
Mar 2, 2026, 4:42:17β€―PMMar 2
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/before/af7f30f4faf631610dd6e6c23b0a2b708fad4ba7/after/46281ba3f15cd3c64b6033e1a0a05be331c2f7b7@github.com>

Foxe Chen

unread,
Mar 2, 2026, 4:45:21β€―PMMar 2
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/before/46281ba3f15cd3c64b6033e1a0a05be331c2f7b7/after/41d6c3c282d9a1c301cf65b568acbce02539b7e2@github.com>

Foxe Chen

unread,
Mar 2, 2026, 4:47:33β€―PMMar 2
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/before/41d6c3c282d9a1c301cf65b568acbce02539b7e2/after/a089f841a4a4e47b29719ededd10eba85e7a3a9a@github.com>

Foxe Chen

unread,
Mar 2, 2026, 4:50:31β€―PMMar 2
to vim/vim, Subscribed
64-bitman left a comment (vim/vim#19541)

Okay I have made it so the escape codes to begin and end synchronized output are configurable by the user. I left the \033[?2026$p escape code hardcoded, because all terminals that support synchronized output use this, and it makes things simpler (esp. when detecting the response).

β€”
Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/c3987108917@github.com>

Christian Brabandt

unread,
Mar 3, 2026, 8:03:28β€―AMMar 3
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19541)

Does this the same as in Neovim? If yes, I assume we cannot change the naming? Because if I hear termsync I associate this setting with :terminal. But that is not the case.
On the other hand, this is not true:

:h 'term<c-d>
'term'           'termbidi'       'termwinkey'     'termwinsize'    'termwintype'    'termencoding'   'termguicolors'  'termwinscroll'

β€”
Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/c3990898080@github.com>

Foxe Chen

unread,
Mar 3, 2026, 9:04:07β€―AMMar 3
to vim/vim, Subscribed
64-bitman left a comment (vim/vim#19541)

Does this the same as in Neovim? If yes, I assume we cannot change the naming? Because if I hear termsync I associate this setting with :terminal. But that is not the case.

On the other hand, this is not true:


:h 'term<c-d>

'term'           'termbidi'       'termwinkey'     'termwinsize'    'termwintype'    'termencoding'   'termguicolors'  'termwinscroll'

I named it termsync because that's what it is named in Neovim. However I suppose we can change the name to something like syncout. What do you think?

β€”
Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/c3991293944@github.com>

Christian Brabandt

unread,
Mar 3, 2026, 4:28:19β€―PMMar 3
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19541)

let's keep it the same as in Neovim

β€”
Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/c3993637453@github.com>

h_east

unread,
Mar 4, 2026, 9:51:31β€―AMMar 4
to vim/vim, Subscribed
h-east left a comment (vim/vim#19541)

let's keep it the same as in Neovim

Yes. Since it is essentially a control for the terminal, I think the term prefix is ​​fine.

β€”
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/c3998033680@github.com>

Foxe Chen

unread,
Mar 4, 2026, 2:04:07β€―PMMar 4
to vim/vim, Push

@64-bitman pushed 1 commit.

β€”
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/before/a089f841a4a4e47b29719ededd10eba85e7a3a9a/after/4b983838125229c0626bea85bcb009391e0820c0@github.com>

Foxe Chen

unread,
Mar 4, 2026, 2:07:30β€―PMMar 4
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/before/4b983838125229c0626bea85bcb009391e0820c0/after/8e5316846a9ec419510dd256dfa835adadac7d43@github.com>

Foxe Chen

unread,
Mar 4, 2026, 2:26:40β€―PMMar 4
to vim/vim, Subscribed
64-bitman left a comment (vim/vim#19541)

I think this is ready

β€”
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/c3999707574@github.com>

Christian Brabandt

unread,
Mar 4, 2026, 4:12:51β€―PMMar 4
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19541)

thanks

β€”
Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/c4000320802@github.com>

Christian Brabandt

unread,
Mar 4, 2026, 4:13:12β€―PMMar 4
to vim/vim, Subscribed

Closed #19541 via 7ba60f1.

β€”
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19541/issue_event/23273984049@github.com>

Reply all
Reply to author
Forward
0 new messages