MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / insertText

Function insertText

src/handlers/quickTools.js:685–708  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

683}
684
685function insertText(value) {
686 const text = String(value ?? "");
687 if (!text) return false;
688
689 const terminalComponent = getActiveTerminalComponent();
690 if (terminalComponent?.terminal) {
691 if (typeof terminalComponent.terminal.paste === "function") {
692 terminalComponent.terminal.paste(text);
693 terminalComponent.focus();
694 return true;
695 }
696
697 if (terminalComponent.serverMode && terminalComponent.isConnected) {
698 terminalComponent.write(text);
699 terminalComponent.focus();
700 return true;
701 }
702
703 return false;
704 }
705
706 const { editor } = editorManager;
707 return editor ? editor.insert(text) : false;
708}
709
710function shiftKeyMapping(char) {
711 switch (char) {

Callers 2

quickTools.jsFile · 0.85
actionsFunction · 0.85

Calls 4

StringInterface · 0.85
focusMethod · 0.80
writeMethod · 0.65

Tested by

no test coverage detected