MCPcopy
hub / github.com/codeaashu/claude-code / onData

Function onData

src/services/mcp/auth.ts:2378–2394  ·  view source on GitHub ↗
(ch: Buffer)

Source from the content-addressed store, hash-verified

2376 process.stdin.setRawMode?.(true)
2377 let secret = ''
2378 const onData = (ch: Buffer) => {
2379 const c = ch.toString()
2380 if (c === '\n' || c === '\r') {
2381 process.stdin.setRawMode?.(false)
2382 process.stdin.removeListener('data', onData)
2383 process.stderr.write('\n')
2384 resolve(secret)
2385 } else if (c === '\u0003') {
2386 process.stdin.setRawMode?.(false)
2387 process.stdin.removeListener('data', onData)
2388 reject(new Error('Cancelled'))
2389 } else if (c === '\u007F' || c === '\b') {
2390 secret = secret.slice(0, -1)
2391 } else {
2392 secret += c
2393 }
2394 }
2395 process.stdin.on('data', onData)
2396 })
2397}

Callers 3

startRecordingFunction · 0.50
startSoxRecordingFunction · 0.50
startArecordRecordingFunction · 0.50

Calls 3

resolveFunction · 0.70
toStringMethod · 0.65
writeMethod · 0.45

Tested by

no test coverage detected