fixup! tui: fix Wayland clipboard paste flakiness

This commit is contained in:
Simon Klee 2026-07-08 15:11:17 +02:00
parent 4957f13337
commit 321eeedd37
No known key found for this signature in database
GPG key ID: B91696044D47BEA3
2 changed files with 1 additions and 18 deletions

View file

@ -197,17 +197,6 @@ export const run = Effect.fn("Tui.run")(function* (input: TuiInput) {
targetFps: 60,
gatherStats: false,
exitOnCtrlC: false,
exitSignals: [
"SIGINT",
"SIGTERM",
"SIGQUIT",
"SIGABRT",
"SIGHUP",
// Interactive stdout cannot break as a pipe, but Wayland clipboard provider pipes can.
...(process.stdout.isTTY ? [] : (["SIGPIPE"] as const)),
"SIGBREAK",
"SIGBUS",
],
useKittyKeyboard: {},
autoFocus: false,
openConsoleOnError: false,

View file

@ -30,7 +30,6 @@ async function mockOpenTuiClipboard(
} = {},
) {
const calls = {
renderer: [] as Parameters<typeof openTui.createCliRenderer>[0][],
host: [] as (HostClipboardOptions | undefined)[],
adapter: [] as RendererClipboardBoundary[],
service: [] as ClipboardOptions[],
@ -58,10 +57,7 @@ async function mockOpenTuiClipboard(
mock.module("@opentui/core", () => ({
...openTui,
createCliRenderer: async (input: Parameters<typeof openTui.createCliRenderer>[0]) => {
calls.renderer.push(input)
return renderer
},
createCliRenderer: async () => renderer,
createHostClipboard: (input?: HostClipboardOptions) => {
if (options.constructionError) throw options.constructionError
calls.host.push(input)
@ -165,8 +161,6 @@ test("SIGHUP clears title and disposes scoped resources once", async () => {
])
expect(clipboard.adapter).toEqual([setup.renderer])
expect(clipboard.service).toHaveLength(1)
expect(clipboard.renderer[0]?.exitSignals).toContain("SIGHUP")
expect(clipboard.renderer[0]?.exitSignals?.includes("SIGPIPE")).toBe(process.stdout.isTTY !== true)
expect(clipboard.dispose).toBe(1)
expect(clipboard.hostDispose).toBe(1)
expect(process.listeners("SIGHUP").every((listener) => listeners.includes(listener))).toBe(true)