GHHG10/CodeServer / opencode /packages /tui /test /clipboard.test.ts
GHHG10's picture
download
raw
798 Bytes
import { expect, test } from "bun:test"
import { copyCommand } from "../src/clipboard"
test("prefers Wayland clipboard when available", () => {
expect(copyCommand("linux", true, (name) => name === "wl-copy")).toEqual(["wl-copy"])
})
test("uses osascript on macOS", () => {
expect(copyCommand("darwin", false, (name) => name === "osascript")).toEqual(["osascript"])
})
test("falls back through X11 clipboard commands", () => {
expect(copyCommand("linux", true, (name) => name === "xclip")).toEqual(["xclip", "-selection", "clipboard"])
expect(copyCommand("linux", false, (name) => name === "xsel")).toEqual(["xsel", "--clipboard", "--input"])
})
test("returns undefined when native clipboard is unavailable", () => {
expect(copyCommand("linux", false, () => false)).toBeUndefined()
})

Xet Storage Details

Size:
798 Bytes
·
Xet hash:
d13f905750e98348d827c5766b192e3b158e2c621ba352c698883a3fdc8e6713

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.