MCPcopy
hub / github.com/anomalyco/opencode / expandKeyAliases

Function expandKeyAliases

packages/tui/src/keymap.tsx:119–126  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

117} as const
118
119function expandKeyAliases(input: string) {
120 const result = Object.entries(KEY_ALIASES).reduce(
121 (acc, [alias, key]) => acc.replace(new RegExp(`(^|[+,\\s>])${alias}(?=$|[+,\\s<])`, "gi"), `$1${key}`),
122 input,
123 )
124 if (result === input) return
125 return result
126}
127
128function registerKeyAliases(keymap: OpenTuiKeymap) {
129 return keymap.appendBindingExpander((ctx) => {

Callers 1

registerKeyAliasesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected