src/vs/workbench/contrib/terminal/browser/terminalService.ts/TerminalService/splitInstance
class TerminalService:	splitInstance(instanceToSplit: ITerminalInstance, shellLaunchConfigOrProfile: IShellLaunchConfig | ITerminalProfile = {}, cwd?: string | URI): ITerminalInstance | null {
		const shellLaunchConfig = this._convertProfileToShellLaunchConfig(shellLaunchConfigOrProfile, cwd);

		// Use the URI from the base instance if it exists, this will correctly split local terminals
		if (typeof shellLaunchConfig.cwd !== 'object' && typeof instanceToSplit.shellLaunchConfig.cwd === 'object') {
			shellLaunchConfig.cwd = URI.from({
				scheme: instanceToSplit.shellLaunchConfig.cwd.scheme,
				path: shellLaunchConfig.cwd || instanceToSplit.shellLaunchConfig.cwd.path
			});
			this._evaluateLocalCwd(shellLaunchConfig);
		}

		// Handle editor terminals
		let instance: ITerminalInstance;
		switch (instanceToSplit.target) {
			case TerminalLocation.Editor:
				instance = this._terminalEditorService.splitInstance(instanceToSplit, shellLaunchConfig);
				break;
			case TerminalLocation.TerminalView:
			default:
				const group = this._terminalGroupService.getGroupForInstance(instanceToSplit);
				if (!group) {
					return null;
				}
				instance = group.split(shellLaunchConfig);
				break;
		}

		this._initInstanceListeners(instance);

		if (instanceToSplit.target !== TerminalLocation.Editor) {
			this._terminalGroupService.groups.forEach((g, i) => g.setVisible(i === this._terminalGroupService.activeGroupIndex));
		}
		return instance;
	}