mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-02 18:39:05 +01:00
add ctrl-shift-c handler for terminal (to copy text)
This commit is contained in:
parent
ad0f11c097
commit
bf03ff2591
@ -117,7 +117,6 @@ class CmdInput extends React.Component<{}, {}> {
|
|||||||
<div
|
<div
|
||||||
ref={this.cmdInputRef}
|
ref={this.cmdInputRef}
|
||||||
className={cn("cmd-input", { "has-info": infoShow }, { active: focusVal })}
|
className={cn("cmd-input", { "has-info": infoShow }, { active: focusVal })}
|
||||||
onClick={this.cmdInputClick}
|
|
||||||
>
|
>
|
||||||
<If condition={historyShow}>
|
<If condition={historyShow}>
|
||||||
<div className="cmd-input-grow-spacer"></div>
|
<div className="cmd-input-grow-spacer"></div>
|
||||||
|
@ -304,7 +304,6 @@ class Cmd {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleData(data: string, termWrap: TermWrap): void {
|
handleData(data: string, termWrap: TermWrap): void {
|
||||||
// console.log("handle data", {data: data});
|
|
||||||
if (!this.isRunning()) {
|
if (!this.isRunning()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -756,6 +755,13 @@ class Screen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
termCustomKeyHandler(e: any, termWrap: TermWrap): boolean {
|
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) {
|
if (termWrap.isRunning) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user