MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / tryCopyViaOsc52

Function tryCopyViaOsc52

cli/src/utils/clipboard.ts:216–231  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

214}
215
216function tryCopyViaOsc52(text: string): boolean {
217 const sequence = buildOsc52Sequence(text)
218 if (!sequence) return false
219
220 const ttyPath = process.platform === 'win32' ? 'CON' : '/dev/tty'
221 let fd: number | null = null
222 try {
223 fd = openSync(ttyPath, 'w')
224 writeSync(fd, sequence)
225 return true
226 } catch {
227 return false
228 } finally {
229 if (fd !== null) closeSync(fd)
230 }
231}

Callers 1

copyTextToClipboardFunction · 0.85

Calls 1

buildOsc52SequenceFunction · 0.85

Tested by

no test coverage detected