src/vs/platform/terminal/node/terminalProcess.ts/TerminalProcess/start
class TerminalProcess:	async start(): Promise<ITerminalLaunchError | undefined> {
		const results = await Promise.all([this._validateCwd(), this._validateExecutable()]);
		const firstError = results.find(r => r !== undefined);
		if (firstError) {
			return firstError;
		}

		let injection: IShellIntegrationConfigInjection | undefined;
		if (this._options.shellIntegration.enabled) {
			injection = getShellIntegrationInjection(this.shellLaunchConfig, this._options.shellIntegration, this._logService);
			if (injection) {
				this._onDidChangeProperty.fire({ type: ProcessPropertyType.UsedShellIntegrationInjection, value: true });
				if (injection.envMixin) {
					for (const [key, value] of Object.entries(injection.envMixin)) {
						this._ptyOptions.env ||= {};
						this._ptyOptions.env[key] = value;
					}
				}
				if (injection.filesToCopy) {
					for (const f of injection.filesToCopy) {
						await fs.mkdir(path.dirname(f.dest), { recursive: true });
						await fs.copyFile(f.source, f.dest);
					}
				}
			} else {
				this._onDidChangeProperty.fire({ type: ProcessPropertyType.FailedShellIntegrationActivation, value: true });
			}
		}

		// Handle zsh shell integration - Set $ZDOTDIR to a temp dir and create $ZDOTDIR/.zshrc
		if (this.shellLaunchConfig.env?.['_ZDOTDIR'] === '1') {
			const zdotdir = path.join(tmpdir(), 'vscode-zsh');
			await fs.mkdir(zdotdir, { recursive: true });
			const source = path.join(path.dirname(FileAccess.asFileUri('', require).fsPath), 'out/vs/workbench/contrib/terminal/browser/media/shellIntegration-rc.zsh');
			await fs.copyFile(source, path.join(zdotdir, '.zshrc'));
			this._ptyOptions.env = this._ptyOptions.env || {};
			this._ptyOptions.env['ZDOTDIR'] = zdotdir;
			delete this._ptyOptions.env['_ZDOTDIR'];
		}

		try {
			await this.setupPtyProcess(this.shellLaunchConfig, this._ptyOptions, injection);
			return undefined;
		} catch (err) {
			this._logService.trace('IPty#spawn native exception', err);
			return { message: `A native exception occurred during launch (${err.message})` };
		}
	}