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.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Foxe Chen
2026-04-06 13:35:27 +00:00
committed by Christian Brabandt
parent a5b6c2d6e9
commit aef812446b
3 changed files with 17 additions and 1 deletions
+4
View File
@@ -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
+11 -1
View File
@@ -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)
+2
View File
@@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
313,
/**/
312,
/**/