mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-11 12:18:28 +00:00
fixup! tui: fix Wayland clipboard paste flakiness
This commit is contained in:
parent
4957f13337
commit
321eeedd37
2 changed files with 1 additions and 18 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue