Skip to content

Commit 26b50ad

Browse files
committed
fix
1 parent afff41b commit 26b50ad

File tree

1 file changed

+10
-19
lines changed

1 file changed

+10
-19
lines changed

src/handlers/quickTools.js

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -729,34 +729,25 @@ function getActiveTerminalInput() {
729729
return getActiveTerminalComponent()?.terminal?.textarea || null;
730730
}
731731

732-
function getInsertValue(value) {
733-
const text = String(value ?? "");
734-
if (
735-
text.length === 1 &&
736-
state.shift &&
737-
!state.ctrl &&
738-
!state.alt &&
739-
!state.meta
740-
) {
741-
return shiftKeyMapping(text);
742-
}
743-
744-
return text;
745-
}
746-
747732
function insertText(value) {
748-
const text = getInsertValue(value);
733+
const text = String(value ?? "");
749734
if (!text) return false;
750735

751736
const terminalComponent = getActiveTerminalComponent();
752737
if (terminalComponent?.terminal) {
753738
if (typeof terminalComponent.terminal.paste === "function") {
754739
terminalComponent.terminal.paste(text);
755-
} else {
740+
terminalComponent.focus();
741+
return true;
742+
}
743+
744+
if (terminalComponent.serverMode && terminalComponent.isConnected) {
756745
terminalComponent.write(text);
746+
terminalComponent.focus();
747+
return true;
757748
}
758-
terminalComponent.focus();
759-
return true;
749+
750+
return false;
760751
}
761752

762753
const { editor } = editorManager;

0 commit comments

Comments
 (0)