Initial commit: NetMesh smart ops platform with 3D topology, inspection reports, RCA and AI ops assistant
Some checks failed
AI automation / Route event (push) Has been cancelled
AI automation / Hand reopened issue to maintainers (push) Has been cancelled
AI automation / Clean source issue state (push) Has been cancelled
AI automation / Reconcile handoffs (push) Has been cancelled
AI automation / Classify issue (push) Has been cancelled
AI automation / Claude Code smoke (push) Has been cancelled
AI automation / Review issue follow-up (push) Has been cancelled
AI automation / Publish issue follow-up (push) Has been cancelled
AI automation / Implement with Claude Code (push) Has been cancelled
AI automation / Publish implement PR (push) Has been cancelled
AI automation / Continue queued issue comments (push) Has been cancelled
AI automation / Codex review loop (push) Has been cancelled
AI automation / Publish Codex fix (push) Has been cancelled
AI automation / Clear Codex dispatch marker (push) Has been cancelled
AI automation / Own PR re-request Codex (push) Has been cancelled
AI automation / External PR re-request Codex (push) Has been cancelled
AI automation / Poll Codex reaction / retry (push) Has been cancelled
Some checks failed
AI automation / Route event (push) Has been cancelled
AI automation / Hand reopened issue to maintainers (push) Has been cancelled
AI automation / Clean source issue state (push) Has been cancelled
AI automation / Reconcile handoffs (push) Has been cancelled
AI automation / Classify issue (push) Has been cancelled
AI automation / Claude Code smoke (push) Has been cancelled
AI automation / Review issue follow-up (push) Has been cancelled
AI automation / Publish issue follow-up (push) Has been cancelled
AI automation / Implement with Claude Code (push) Has been cancelled
AI automation / Publish implement PR (push) Has been cancelled
AI automation / Continue queued issue comments (push) Has been cancelled
AI automation / Codex review loop (push) Has been cancelled
AI automation / Publish Codex fix (push) Has been cancelled
AI automation / Clear Codex dispatch marker (push) Has been cancelled
AI automation / Own PR re-request Codex (push) Has been cancelled
AI automation / External PR re-request Codex (push) Has been cancelled
AI automation / Poll Codex reaction / retry (push) Has been cancelled
This commit is contained in:
37
components/terminal/runtime/optionYankLastArg.ts
Normal file
37
components/terminal/runtime/optionYankLastArg.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
export interface OptionYankLastArgKeyEvent {
|
||||
key: string;
|
||||
code?: string;
|
||||
altKey: boolean;
|
||||
ctrlKey: boolean;
|
||||
metaKey: boolean;
|
||||
shiftKey: boolean;
|
||||
}
|
||||
|
||||
const isPeriodKey = (e: OptionYankLastArgKeyEvent): boolean => (
|
||||
e.code === "Period" || e.key === "." || e.key === "≥"
|
||||
);
|
||||
|
||||
const isUnderscoreKey = (e: OptionYankLastArgKeyEvent): boolean => (
|
||||
e.key === "_" || (e.code === "Minus" && e.shiftKey)
|
||||
);
|
||||
|
||||
/**
|
||||
* macOS Option+. / Option+_ → readline yank-last-arg (issue #2364).
|
||||
*
|
||||
* Ghostty/iTerm2/kitty/VS Code do not implement this themselves — they pass
|
||||
* Meta-. through to bash/zsh. On macOS, Option+. types "≥" unless Option is
|
||||
* Meta, so map those two physical keys to ESC+. / ESC+_ without turning every
|
||||
* Option chord into Meta (unlike `altAsMeta`).
|
||||
*
|
||||
* Gated to macOS: Linux/Windows Alt+. already sends the ESC prefix via xterm.
|
||||
*/
|
||||
export function optionYankLastArgSequence(
|
||||
e: OptionYankLastArgKeyEvent,
|
||||
isMac: boolean,
|
||||
): string | null {
|
||||
if (!isMac) return null;
|
||||
if (!e.altKey || e.ctrlKey || e.metaKey) return null;
|
||||
if (isPeriodKey(e) && !e.shiftKey) return "\x1b.";
|
||||
if (isUnderscoreKey(e)) return "\x1b_";
|
||||
return null;
|
||||
}
|
||||
Reference in New Issue
Block a user