()
| 116 | } |
| 117 | }; |
| 118 | const pasteIntoTerminal = async () => { |
| 119 | if (!terminal) { |
| 120 | return; |
| 121 | } |
| 122 | try { |
| 123 | const text = await readFromClipboard(); |
| 124 | if (text) { |
| 125 | terminal.paste(text); |
| 126 | } |
| 127 | } catch (error) { |
| 128 | toast.error("Failed to paste from clipboard"); |
| 129 | console.error(error); |
| 130 | } finally { |
| 131 | terminal.focus(); |
| 132 | } |
| 133 | }; |
| 134 | |
| 135 | const [hasBeenVisible, setHasBeenVisible] = useState(false); |
| 136 | if (isVisible && !hasBeenVisible) { |