mirror of
https://github.com/wavetermdev/waveterm
synced 2026-05-24 09:18:27 +00:00
Cmd-ESC now toggles both ways
This commit is contained in:
parent
8e3540f754
commit
b7b813a4a7
1 changed files with 13 additions and 0 deletions
|
|
@ -180,6 +180,19 @@ const TerminalView = ({ blockId }: { blockId: string }) => {
|
|||
blockid: blockId,
|
||||
termsize: { rows: newTerm.rows, cols: newTerm.cols },
|
||||
});
|
||||
connectElemRef.current.addEventListener(
|
||||
"keydown",
|
||||
(ev) => {
|
||||
if (ev.code == "Escape" && ev.metaKey) {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
const metaCmd: BlockSetMetaCommand = { command: "setmeta", meta: { "term:mode": "html" } };
|
||||
services.BlockService.SendCommand(blockId, metaCmd);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
true
|
||||
);
|
||||
newTerm.onData((data) => {
|
||||
const b64data = btoa(data);
|
||||
const inputCmd: BlockInputCommand = { command: "controller:input", inputdata64: b64data };
|
||||
|
|
|
|||
Loading…
Reference in a new issue