patch 9.2.0313: Callback channel not registered in GUI
Commit:
https://github.com/vim/vim/commit/aef812446bfe6a84c3d74883d43c1afa8c19df85
Author: Foxe Chen <
chen...@gmail.com>
Date: Mon Apr 6 13:35:27 2026 +0000
patch 9.2.0313: Callback channel not registered in GUI
Problem: Callback channel not registered in GUI
Solution: Call channel_gui_register_one() in GUI mode
(Foxe Chen).
closes: #19858
Signed-off-by: Foxe Chen <
chen...@gmail.com>
Signed-off-by: Christian Brabandt <
c...@256bit.org>
diff --git a/src/channel.c b/src/channel.c
index 4607b1e60..442c33a50 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -4299,6 +4299,10 @@ channel_read(channel_T *channel, ch_part_T part, char *func)
newchannel->CH_SOCK_FD = (sock_T)newfd;
newchannel->ch_to_be_closed |= (1U << PART_SOCK);
+#ifdef FEAT_GUI
+ channel_gui_register_one(newchannel, PART_SOCK);
+#endif
+
if (client.ss_family == AF_INET)
{
#ifdef HAVE_INET_NTOP
diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim
index 203ae0428..6cd55ca9f 100644
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -2763,10 +2763,17 @@ endfunc
let g:server_received_addr = ''
let g:server_received_msg = ''
+let g:server_received_input = ''
+
+func s:test_listen_input(ch, msg)
+ let g:server_received_input = a:msg
+endfunc
func s:test_listen_accept(ch, addr)
let g:server_received_addr = a:addr
let g:server_received_msg = ch_readraw(a:ch)
+
+ call ch_setoptions(a:ch, #{mode: "raw", callback: function('s:test_listen_input')})
endfunction
func Test_listen()
@@ -2782,7 +2789,10 @@ func Test_listen()
return
endif
call ch_sendraw(handle, 'hello')
- call WaitFor('"" != g:server_received_msg')
+ call WaitFor('"hello" == g:server_received_msg')
+ call ch_sendraw(handle, 'notify')
+ call WaitFor('"notify" == g:server_received_input')
+
call ch_close(handle)
call ch_close(server)
call assert_equal('hello', g:server_received_msg)
diff --git a/src/version.c b/src/version.c
index 6dc2b537b..438790124 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 313,
/**/
312,
/**/