src/vs/workbench/contrib/terminal/browser/terminalService.ts/TerminalService/createTerminal
class TerminalService:	createTerminal(options?: ICreateTerminalOptions): ITerminalInstance {
		const shellLaunchConfig = this._convertProfileToShellLaunchConfig(options?.config || options);

		if (options?.cwd) {
			shellLaunchConfig.cwd = options.cwd;
		}

		if (!shellLaunchConfig.customPtyImplementation && !this.isProcessSupportRegistered) {
			throw new Error('Could not create terminal when process support is not registered');
		}
		if (shellLaunchConfig.hideFromUser) {
			const instance = this.createInstance(shellLaunchConfig);
			this._backgroundedTerminalInstances.push(instance);
			this._backgroundedTerminalDisposables.set(instance.instanceId, [
				instance.onDisposed(this._onDidDisposeInstance.fire, this._onDidDisposeInstance)
			]);
			this._initInstanceListeners(instance);
			return instance;
		}

		this._evaluateLocalCwd(shellLaunchConfig);

		let instance: ITerminalInstance;
		if (options?.target === TerminalLocation.Editor) {
			instance = this.createInstance(shellLaunchConfig);
			instance.target = TerminalLocation.Editor;
			this._terminalEditorService.openEditor(instance);
		} else {
			const group = this._terminalGroupService.createGroup(shellLaunchConfig);
			instance = group.terminalInstances[0];
		}
		this._initInstanceListeners(instance);
		return instance;
	}