mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
add ctrl-shift-c handler for terminal (to copy text)
This commit is contained in:
@@ -117,7 +117,6 @@ class CmdInput extends React.Component<{}, {}> {
|
||||
<div
|
||||
ref={this.cmdInputRef}
|
||||
className={cn("cmd-input", { "has-info": infoShow }, { active: focusVal })}
|
||||
onClick={this.cmdInputClick}
|
||||
>
|
||||
<If condition={historyShow}>
|
||||
<div className="cmd-input-grow-spacer"></div>
|
||||
|
||||
+7
-1
@@ -304,7 +304,6 @@ class Cmd {
|
||||
}
|
||||
|
||||
handleData(data: string, termWrap: TermWrap): void {
|
||||
// console.log("handle data", {data: data});
|
||||
if (!this.isRunning()) {
|
||||
return;
|
||||
}
|
||||
@@ -756,6 +755,13 @@ class Screen {
|
||||
}
|
||||
|
||||
termCustomKeyHandler(e: any, termWrap: TermWrap): boolean {
|
||||
if (e.type == "keypress" && e.code == "KeyC" && e.shiftKey && e.ctrlKey) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
let sel = termWrap.terminal.getSelection();
|
||||
navigator.clipboard.writeText(sel);
|
||||
return false;
|
||||
}
|
||||
if (termWrap.isRunning) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user