MCPcopy Index your code
hub / github.com/coder/coder / pasteIntoTerminal

Function pasteIntoTerminal

site/src/modules/terminal/WorkspaceTerminal.tsx:118–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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) {

Callers 1

WorkspaceTerminalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected