src/vs/workbench/contrib/terminal/browser/terminalEditorInput.ts/TerminalEditorInput/setTerminalInstance
class TerminalEditorInput:	setTerminalInstance(instance: ITerminalInstance): void {
		if (this._terminalInstance) {
			throw new Error('cannot set instance that has already been set');
		}
		this._terminalInstance = instance;
		this._setupInstanceListeners();

		// Refresh dirty state when the confirm on kill setting is changed
		this._configurationService.onDidChangeConfiguration(e => {
			if (e.affectsConfiguration(TerminalSettingId.ConfirmOnKill)) {
				this._onDidChangeDirty.fire();
			}
		});
	}