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

Method copySelectionNoClear

src/ink/ink.tsx:1016–1027  ·  view source on GitHub ↗

* Copy the current selection to the clipboard without clearing the * highlight. Matches iTerm2's copy-on-select behavior where the selected * region stays visible after the automatic copy.

()

Source from the content-addressed store, hash-verified

1014 * region stays visible after the automatic copy.
1015 */
1016 copySelectionNoClear(): string {
1017 if (!hasSelection(this.selection)) return '';
1018 const text = getSelectedText(this.selection, this.frontFrame.screen);
1019 if (text) {
1020 // Raw OSC 52, or DCS-passthrough-wrapped OSC 52 inside tmux (tmux
1021 // drops it silently unless allow-passthrough is on — no regression).
1022 void setClipboard(text).then(raw => {
1023 if (raw) this.options.stdout.write(raw);
1024 });
1025 }
1026 return text;
1027 }
1028
1029 /**
1030 * Copy the current text selection to the system clipboard via OSC 52

Callers 3

copySelectionMethod · 0.95
useSelectionFunction · 0.80
useCopyOnSelectFunction · 0.80

Calls 4

hasSelectionFunction · 0.85
getSelectedTextFunction · 0.85
setClipboardFunction · 0.85
writeMethod · 0.45

Tested by

no test coverage detected