src/vs/workbench/contrib/terminal/browser/terminalEditorService.ts/TerminalEditorService/getOrCreateEditorInput
class TerminalEditorService:	getOrCreateEditorInput(instance: ITerminalInstance | SerializedTerminalEditorInput, isFutureSplit: boolean = false): TerminalEditorInput {
		let cachedEditor;
		if ('id' in instance) {
			cachedEditor = this._editorInputs.get(instance.id);
		} else if ('instanceId' in instance) {
			cachedEditor = this._editorInputs.get(instance.instanceId);
		}
		if (cachedEditor) {
			return cachedEditor;
		}

		if ('pid' in instance) {
			instance = this._terminalInstanceService.createInstance({ attachPersistentProcess: instance }, TerminalLocation.Editor);
		}

		const input = this._instantiationService.createInstance(TerminalEditorInput, instance);
		instance.target = TerminalLocation.Editor;
		this._editorInputs.set(instance.instanceId, input);
		this._instanceDisposables.set(instance.instanceId, [
			instance.onDisposed(this._onDidDisposeInstance.fire, this._onDidDisposeInstance),
			instance.onFocus(this._onDidFocusInstance.fire, this._onDidFocusInstance)
		]);
		this.instances.push(instance);
		this._onDidChangeInstances.fire();
		return input;
	}