MCPcopy Create free account
hub / github.com/Marus/cortex-debug / rttCreateTerninal

Method rttCreateTerninal

src/frontend/extension.ts:828–849  ·  view source on GitHub ↗
(e: vscode.DebugSessionCustomEvent, decoder: RTTConsoleDecoderOpts)

Source from the content-addressed store, hash-verified

826 }
827
828 private rttCreateTerninal(e: vscode.DebugSessionCustomEvent, decoder: RTTConsoleDecoderOpts) {
829 this.createRTTSource(e, decoder.tcpPort, decoder.port).then((src: SocketRTTSource) => {
830 for (const terminal of this.rttTerminals) {
831 const success = !terminal.inUse && terminal.tryReuse(decoder, src);
832 if (success) {
833 if (vscode.debug.activeDebugConsole) {
834 vscode.debug.activeDebugConsole.appendLine(
835 `Reusing RTT terminal for channel ${decoder.port} on tcp port ${decoder.tcpPort}`
836 );
837 }
838 return;
839 }
840 }
841 const newTerminal = new RTTTerminal(this.context, decoder, src);
842 this.rttTerminals.push(newTerminal);
843 if (vscode.debug.activeDebugConsole) {
844 vscode.debug.activeDebugConsole.appendLine(
845 `Created RTT terminal for channel ${decoder.port} on tcp port ${decoder.tcpPort}`
846 );
847 }
848 });
849 }
850
851 private terminalClosed(terminal: vscode.Terminal) {
852 this.rttTerminals = this.rttTerminals.filter((t) => t.terminal !== terminal);

Callers 1

Calls 2

createRTTSourceMethod · 0.95
tryReuseMethod · 0.80

Tested by

no test coverage detected