Skip to content

@jsvision/web / attachKeyReclaim

Function: attachKeyReclaim()

attachKeyReclaim(_term, options?): () => void

Defined in: key-reclaim.ts:137

Attach key-chord reclaim to a terminal.

Parameters

_term

TerminalLike

the terminal the reclaim serves (the listener is document-global; a minimal handle is enough). Reserved to document intent and for forward compatibility.

options?

KeyReclaimOptions = {}

extra chords, an isFocused predicate, and/or a custom event target.

Returns

an unsubscribe function that removes the listener.

() => void

Example

ts
import { attachKeyReclaim } from '@jsvision/web';

// Reclaim the defaults plus Ctrl+X while the terminal is focused.
const detach = attachKeyReclaim(term, { also: ['Ctrl+X'] });
// later: detach();