Merge main into the terminal flow-control branch
Conflicts resolved keeping both sides: main's active-client rules, input lane, reply marking and key input, and this branch's flow control, acknowledgements, subscriptions and sliced emulator feed. terminal_ack joins the terminal lane; the feed marks each live slice it writes as drawing, so the emulator's answers still go to onReply. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -123,12 +123,14 @@ func TestTerminalOverWebsocket(t *testing.T) {
|
||||
// Its reply is not awaited: that would skip the echo's frames.
|
||||
writeChat(t, ctx, conns[0], terminalRequest(protocol.TerminalInput, "in", protocol.TerminalRequest{TerminalID: term.ID, Data: "pwd; echo sum-$((40+2))\r"}))
|
||||
_, end := readTerminalUntil(t, ctx, conns[0], term.ID, synced.OutputEnd, "sum-42")
|
||||
// The second client draws it larger; the opener stays the active client
|
||||
// (terminal_active_test.go) until the second one types below.
|
||||
resized := terminalReply(t, ctx, conns[1], terminalRequest(protocol.TerminalResize, "size", protocol.TerminalRequest{TerminalID: term.ID, Cols: 120, Rows: 33}))
|
||||
if resized.Type != protocol.TerminalResize || resized.Terminal.Cols != 120 || resized.Terminal.Rows != 33 {
|
||||
if resized.Type != protocol.TerminalResize || resized.Terminal.Cols != 80 || resized.Terminal.Rows != 24 {
|
||||
t.Fatalf("resize reply = %+v", resized)
|
||||
}
|
||||
list := terminalReply(t, ctx, conns[1], terminalRequest(protocol.TerminalList, "list", protocol.TerminalRequest{}))
|
||||
if len(list.Terminals) != 1 || list.Terminals[0].ID != term.ID || list.Terminals[0].Cols != 120 || list.Terminals[0].Output != "" {
|
||||
if len(list.Terminals) != 1 || list.Terminals[0].ID != term.ID || list.Terminals[0].Cols != 80 || list.Terminals[0].Output != "" {
|
||||
t.Fatalf("list = %+v", list.Terminals)
|
||||
}
|
||||
// The second client reads everything once, then only what follows.
|
||||
|
||||
Reference in New Issue
Block a user