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

Function releasePressed

src/utils/computerUse/executor.ts:131–140  ·  view source on GitHub ↗

* Release `pressed` in reverse (last pressed = first released). Errors are * swallowed so a release failure never masks the real error. * * Drains via pop() rather than snapshotting length: if a drainRunLoop- * orphaned press lambda resolves an in-flight input.key() AFTER finally * calls us, th

(input: Input, pressed: string[])

Source from the content-addressed store, hash-verified

129 * orphaned flag stops the lambda at its NEXT check, not the current await.
130 */
131async function releasePressed(input: Input, pressed: string[]): Promise<void> {
132 let k: string | undefined
133 while ((k = pressed.pop()) !== undefined) {
134 try {
135 await input.key(k, 'release')
136 } catch {
137 // Swallow — best-effort release.
138 }
139 }
140}
141
142/**
143 * Bracket `fn()` with modifier press/release. `pressed` tracks which presses

Callers 2

withModifiersFunction · 0.85
holdKeyFunction · 0.85

Calls 1

popMethod · 0.80

Tested by

no test coverage detected