mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
Fix terminal resize race (#2059)
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { CreateTerminalRequestSchema } from "./messages";
|
||||
|
||||
// COMPAT(createTerminalSize): the size field is optional so old clients (which send no size)
|
||||
// still parse, and old daemons ignore it. These tests pin that contract.
|
||||
// The optional size field stays accepted permanently: released v0.1.107 clients send it, newer
|
||||
// app clients don't, and programmatic callers may. These tests pin that contract.
|
||||
describe("CreateTerminalRequest size", () => {
|
||||
const base = {
|
||||
type: "create_terminal_request" as const,
|
||||
|
||||
@@ -2122,10 +2122,10 @@ export const CreateTerminalRequestSchema = z.object({
|
||||
agentId: z.string().optional(),
|
||||
command: z.string().optional(),
|
||||
args: z.array(z.string()).optional(),
|
||||
// COMPAT(createTerminalSize): added in v0.1.107, drop the optional gate when floor >= v0.1.107.
|
||||
// The client seeds the PTY with its measured viewport size so a new terminal isn't born at the
|
||||
// 80x24 default and then visibly reflowed. Old daemons ignore this field and start at 80x24;
|
||||
// the client's first resize corrects it as before.
|
||||
// Initial PTY size. Added in v0.1.107; the app no longer sends it (the estimate cache that fed
|
||||
// it was removed — the pane-focus resize claim sizes the PTY instead). Kept and honored
|
||||
// permanently: released v0.1.107 clients still send it, and programmatic callers may pass an
|
||||
// exact size. Daemons without it start at 80x24 and the first resize corrects that.
|
||||
size: z
|
||||
.object({
|
||||
rows: z.number().int().positive(),
|
||||
|
||||
Reference in New Issue
Block a user