(value)
| 683 | } |
| 684 | |
| 685 | function 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 | |
| 710 | function shiftKeyMapping(char) { |
| 711 | switch (char) { |
no test coverage detected