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

Method createTermName

src/frontend/rtt_terminal.ts:146–159  ·  view source on GitHub ↗
(options: RTTConsoleDecoderOpts, existing: string | null)

Source from the content-addressed store, hash-verified

144 }
145
146 protected static createTermName(options: RTTConsoleDecoderOpts, existing: string | null): string {
147 const suffix = options.type === 'binary' ? `enc:${getBinaryEncoding(options.encoding)}` : options.type;
148 const orig = options.label || `RTT Ch:${options.port} ${suffix}`;
149 let ret = orig;
150 let count = 1;
151 while (vscode.window.terminals.findIndex((t) => t.name === ret) >= 0) {
152 if (existing === ret) {
153 return existing;
154 }
155 ret = `${orig}-${count}`;
156 count++;
157 }
158 return ret;
159 }
160
161 protected terminalClosed() {
162 this.dispose();

Callers 2

createTermOptionsMethod · 0.45
tryReuseMethod · 0.45

Calls 1

getBinaryEncodingFunction · 0.85

Tested by

no test coverage detected