jiebi/CodeConvo huggingface dataset:
import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle'; import { launchSchemaId } from 'vs/workbench/services/configuration/common/configuration'; import { LoadedScriptsView } from 'vs/workbench/contrib/debug/browser/loadedScriptsView'; <del> import { RunToCursorAction } from 'vs/workbench/contrib/debug/browser/debugEditorActions'; </del> <ins> import { RunToCursorAction, SelectionToReplAction, SelectionToWatchExpressionsAction } from 'vs/workbench/contrib/debug/browser/debugEditorActions'; </ins> import { WatchExpressionsView, ADD_WATCH_LABEL, REMOVE_WATCH_EXPRESSIONS_COMMAND_ID, REMOVE_WATCH_EXPRESSIONS_LABEL, ADD_WATCH_ID } from 'vs/workbench/contrib/debug/browser/watchExpressionsView'; import { VariablesView, SET_VARIABLE_ID, COPY_VALUE_ID, BREAK_WHEN_VALUE_CHANGES_ID, COPY_EVALUATE_PATH_ID, ADD_TO_WATCH_ID, BREAK_WHEN_VALUE_IS_ACCESSED_ID, BREAK_WHEN_VALUE_IS_READ_ID, VIEW_MEMORY_ID } from 'vs/workbench/contrib/debug/browser/variablesView'; import { Repl } from 'vs/workbench/contrib/debug/browser/repl';
import { DisassemblyViewInput } from 'vs/workbench/contrib/debug/common/disassemblyViewInput'; import { DebugLifecycle } from 'vs/workbench/contrib/debug/common/debugLifecycle'; import { Icon } from 'vs/platform/action/common/action'; <ins> import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; </ins> const debugCategory = nls.localize('debugCategory', "Debug"); registerColors();
registerDebugCommandPaletteItem(JUMP_TO_CURSOR_ID, nls.localize('jumpToCursor', "Jump to Cursor"), CONTEXT_JUMP_TO_CURSOR_SUPPORTED); registerDebugCommandPaletteItem(JUMP_TO_CURSOR_ID, nls.localize('SetNextStatement', "Set Next Statement"), CONTEXT_JUMP_TO_CURSOR_SUPPORTED); registerDebugCommandPaletteItem(RunToCursorAction.ID, RunToCursorAction.LABEL, ContextKeyExpr.and(CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_STATE.isEqualTo('stopped'))); <ins> registerDebugCommandPaletteItem(SelectionToReplAction.ID, SelectionToReplAction.LABEL, ContextKeyExpr.and(EditorContextKeys.hasNonEmptySelection, CONTEXT_IN_DEBUG_MODE)); registerDebugCommandPaletteItem(SelectionToWatchExpressionsAction.ID, SelectionToWatchExpressionsAction.LABEL, ContextKeyExpr.and(EditorContextKeys.hasNonEmptySelection, CONTEXT_IN_DEBUG_MODE)); </ins> registerDebugCommandPaletteItem(TOGGLE_INLINE_BREAKPOINT_ID, nls.localize('inlineBreakpoint', "Inline Breakpoint")); registerDebugCommandPaletteItem(DEBUG_START_COMMAND_ID, DEBUG_START_LABEL, ContextKeyExpr.and(CONTEXT_DEBUGGERS_AVAILABLE, CONTEXT_DEBUG_STATE.notEqualsTo(getStateLabel(State.Initializing)))); registerDebugCommandPaletteItem(DEBUG_RUN_COMMAND_ID, DEBUG_RUN_LABEL, ContextKeyExpr.and(CONTEXT_DEBUGGERS_AVAILABLE, CONTEXT_DEBUG_STATE.notEqualsTo(getStateLabel(State.Initializing))));
} } <del> class SelectionToReplAction extends EditorAction { </del> <ins> export class SelectionToReplAction extends EditorAction { public static readonly ID = 'editor.debug.action.selectionToRepl'; public static readonly LABEL = nls.localize('evaluateInDebugConsole', "Evaluate in Debug Console"); </ins> constructor() { super({ <del> id: 'editor.debug.action.selectionToRepl', label: nls.localize('evaluateInDebugConsole', "Evaluate in Debug Console"), alias: 'Evaluate', </del> <ins> id: SelectionToReplAction.ID, label: SelectionToReplAction.LABEL, alias: 'Debug: Evaluate in Console', </ins> precondition: ContextKeyExpr.and(EditorContextKeys.hasNonEmptySelection, CONTEXT_IN_DEBUG_MODE, EditorContextKeys.editorTextFocus), contextMenuOpts: { group: 'debug',
} } <del> class SelectionToWatchExpressionsAction extends EditorAction { </del> <ins> export class SelectionToWatchExpressionsAction extends EditorAction { public static readonly ID = 'editor.debug.action.selectionToWatch'; public static readonly LABEL = nls.localize('addToWatch', "Add to Watch"); </ins> constructor() { super({ <del> id: 'editor.debug.action.selectionToWatch', label: nls.localize('addToWatch', "Add to Watch"), alias: 'Add to Watch', </del> <ins> id: SelectionToWatchExpressionsAction.ID, label: SelectionToWatchExpressionsAction.LABEL, alias: 'Debug: Add to Watch', </ins> precondition: ContextKeyExpr.and(EditorContextKeys.hasNonEmptySelection, CONTEXT_IN_DEBUG_MODE, EditorContextKeys.editorTextFocus), contextMenuOpts: { group: 'debug',
if (outputModified && !outputMetadataChangeOnly) { const originalOutputRenderListener = this.notebookEditor.onDidDynamicOutputRendered(e => { <del> if (e.cell.uri.toString() === this.cell.original.uri.toString()) { </del> <ins> if (e.cell.uri.toString() === this.cell.original.uri.toString() && this.cell.checkIfOutputsModified()) { </ins> this.notebookEditor.deltaCellOutputContainerClassNames(DiffSide.Original, this.cell.original.id, ['nb-cellDeleted'], []); originalOutputRenderListener.dispose(); } }); const modifiedOutputRenderListener = this.notebookEditor.onDidDynamicOutputRendered(e => { <del> if (e.cell.uri.toString() === this.cell.modified.uri.toString()) { </del> <ins> if (e.cell.uri.toString() === this.cell.modified.uri.toString() && this.cell.checkIfOutputsModified()) { </ins> this.notebookEditor.deltaCellOutputContainerClassNames(DiffSide.Modified, this.cell.modified.id, ['nb-cellAdded'], []); modifiedOutputRenderListener.dispose(); }
if (this.cell.checkIfOutputsModified()) { this.notebookEditor.deltaCellOutputContainerClassNames(DiffSide.Original, this.cell.original.id, ['nb-cellDeleted'], []); this.notebookEditor.deltaCellOutputContainerClassNames(DiffSide.Modified, this.cell.modified.id, ['nb-cellAdded'], []); <ins> } else { this.notebookEditor.deltaCellOutputContainerClassNames(DiffSide.Original, this.cell.original.id, [], ['nb-cellDeleted']); this.notebookEditor.deltaCellOutputContainerClassNames(DiffSide.Modified, this.cell.modified.id, [], ['nb-cellAdded']); </ins> } }
import { ContextKeyExpr, ContextKeyExpression } from 'vs/platform/contextkey/common/contextkey'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { ActiveEditorContext } from 'vs/workbench/common/contextkeys'; <del> import { DiffElementViewModelBase } from 'vs/workbench/contrib/notebook/browser/diff/diffElementViewModel'; </del> <ins> import { DiffElementViewModelBase, SideBySideDiffElementViewModel } from 'vs/workbench/contrib/notebook/browser/diff/diffElementViewModel'; </ins> import { INotebookTextDiffEditor, NOTEBOOK_DIFF_CELL_INPUT, NOTEBOOK_DIFF_CELL_PROPERTY, NOTEBOOK_DIFF_CELL_PROPERTY_EXPANDED } from 'vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser'; import { NotebookTextDiffEditor } from 'vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor'; import { NotebookDiffEditorInput } from 'vs/workbench/contrib/notebook/common/notebookDiffEditorInput';
import { DEFAULT_EDITOR_ASSOCIATION } from 'vs/workbench/common/editor'; import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; <del> import { NOTEBOOK_DIFF_EDITOR_ID } from 'vs/workbench/contrib/notebook/common/notebookCommon'; </del> <ins> import { CellEditType, NOTEBOOK_DIFF_EDITOR_ID } from 'vs/workbench/contrib/notebook/common/notebookCommon'; </ins> // ActiveEditorContext.isEqualTo(SearchEditorConstants.SearchEditorID)
return; } <ins> if (!(context.cell instanceof SideBySideDiffElementViewModel)) { return; } </ins> const original = context.cell.original; const modified = context.cell.modified; <del> if (!original || !modified) { </del> <ins> const modifiedCellIndex = context.cell.mainDocumentTextModel.cells.indexOf(modified.textModel); if (modifiedCellIndex === -1) { </ins> return; } <del> modified.textModel.spliceNotebookCellOutputs({ start: 0, deleteCount: modified.outputs.length, newOutputs: original.outputs }); </del> <ins> context.cell.mainDocumentTextModel.applyEdits([{ editType: CellEditType.Output, index: modifiedCellIndex, outputs: original.outputs }], true, undefined, () => undefined, undefined, true); </ins> } });
@IContextKeyService contextKeyService: IContextKeyService, @IConfigurationService private readonly configurationService: IConfigurationService ) { <del> super(editor, { keepEditorSelection: true }); </del> <ins> super(editor, { keepEditorSelection: true, isAccessible: true }); </ins> this._contextKeyService = contextKeyService.createScoped(this.domNode); this._scopedInstantiationService = instantiationService.createChild(new ServiceCollection(
import { ICredentialsService } from 'vs/platform/credentials/common/credentials'; import { IEncryptionService } from 'vs/workbench/services/encryption/common/encryptionService'; import { ExtHostContext, ExtHostSecretStateShape, MainContext, MainThreadSecretStateShape } from '../common/extHost.protocol'; <ins> import { ILogService } from 'vs/platform/log/common/log'; </ins> @extHostNamedCustomer(MainContext.MainThreadSecretState) export class MainThreadSecretState extends Disposable implements MainThreadSecretStateShape {
async $getPassword(extensionId: string, key: string): Promise<string | undefined> { const fullKey = await this.getFullKey(extensionId); const password = await this.credentialsService.getPassword(fullKey, key); <del> const decrypted = password && await this.encryptionService.decrypt(password); </del> <ins> if (!password) { return undefined; } let decrypted: string | null; try { decrypted = await this.encryptionService.decrypt(password); } catch (e) { this.logService.error(e); // If we are on a platform that newly started encrypting secrets before storing them, // then passwords previously stored were stored un-encrypted (NOTE: but still being stored in a secure keyring). // When we try to decrypt a password that wasn't encrypted previously, the encryption service will throw. // To recover gracefully, we first try to encrypt & store the password (essentially migrating the secret to the new format) // and then we try to read it and decrypt again. const encryptedForSet = await this.encryptionService.encrypt(password); await this.credentialsService.setPassword(fullKey, key, encryptedForSet); const passwordEncrypted = await this.credentialsService.getPassword(fullKey, key); decrypted = passwordEncrypted && await this.encryptionService.decrypt(passwordEncrypted); } </ins> if (decrypted) { try {
const minimapOpts = options.get(EditorOption.minimap); const minimapEnabled = minimapOpts.enabled; const minimapSide = minimapOpts.side; <del> const backgroundColor = minimapEnabled ? theme.getColor(editorOverviewRulerBackground) || TokenizationRegistry.getDefaultBackground() : null; </del> <ins> const themeColor = theme.getColor(editorOverviewRulerBackground); const defaultBackground = TokenizationRegistry.getDefaultBackground(); let backgroundColor: Color | null = null; if (themeColor !== undefined) { backgroundColor = themeColor; } else if (minimapEnabled) { backgroundColor = defaultBackground; } </ins> if (backgroundColor === null || minimapSide === 'left') { this.backgroundColor = null;
this._register(this.extensionService.onDidRegisterExtensions(() => this.onDidRegisterExtensions())); <ins> // Cached View Containers Locations should be registered before Cached View Positions // Because View Containers cache should be updated first because View Positions Cache depends on View Containers Cache if views are moved to generated view containers </ins> Registry.as<IProfileStorageRegistry>(Extensions.ProfileStorageRegistry) .registerKeys([{ <del> key: ViewDescriptorService.CACHED_VIEW_POSITIONS, description: localize('cachedViewPositions', "View locations customizations"), }, { </del> key: ViewDescriptorService.CACHED_VIEW_CONTAINER_LOCATIONS, description: localize('cachedViewContainerPositions', "View Container locations customizations"), <ins> }, { key: ViewDescriptorService.CACHED_VIEW_POSITIONS, description: localize('cachedViewPositions', "View locations customizations"), </ins> }]); }
*  Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ <del> import { createWriteStream } from 'fs'; </del> import { tmpdir } from 'os'; <ins> import { Queue } from 'vs/base/common/async'; </ins> import { randomPath } from 'vs/base/common/extpath'; <ins> import { Promises } from 'vs/base/node/pfs'; </ins> import { resolveTerminalEncoding } from 'vs/base/node/terminalEncoding'; export function hasStdinWithoutTty() {
} // Pipe into tmp file using terminals encoding <ins> // Use a `Queue` to be able to use `appendFile` // which helps file watchers to be aware of the // changes because each append closes the underlying // file descriptor. // (https://github.com/microsoft/vscode/issues/148952) </ins> const decoder = iconv.getDecoder(encoding); <del> process.stdin.on('data', chunk => stdinFileStream.write(decoder.write(chunk))); </del> <ins> const appendFileQueue = new Queue(); process.stdin.on('data', chunk => { const chunkStr = decoder.write(chunk); appendFileQueue.queue(() => Promises.appendFile(targetPath, chunkStr)); }); </ins> process.stdin.on('end', () => { const end = decoder.end(); if (typeof end === 'string') { <del> stdinFileStream.write(end); </del> <ins> appendFileQueue.queue(() => Promises.appendFile(targetPath, end)); </ins> } <del> stdinFileStream.end(); </del> }); <del> process.stdin.on('error', error => stdinFileStream.destroy(error)); process.stdin.on('close', () => stdinFileStream.close()); </del> }
<ins> name: Bad Tag on: create jobs: main: runs-on: ubuntu-latest if: github.event.ref == '1.999.0' steps: - name: Checkout Actions uses: actions/checkout@v2 with: repository: "microsoft/vscode-github-triage-actions" ref: stable path: ./actions - name: Install Actions run: npm install --production --prefix ./actions - name: Run Bad Tag uses: ./actions/tag-alert with: token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}} tag-name: '1.999.0' </ins>
this.setFullScreen(true); } <del> if (!this._win.isVisible()) { </del> <ins> if ( !this._win.isVisible() || // TODO@electron: Required condition ever since https://github.com/electron/electron/pull/33536 // landed in Electron 17.4.2: calling `window.maximize()` on macOS will wrongly result in // `window.isVisible()` to return `true` even though a different window might still be on top. // As such, we also need to ask for `window.isFocused()` which on macOS will ask whether the // window is a "key" window. (isMacintosh && !this._win.isFocused()) ) { </ins> this._win.show(); // to reduce flicker from the default window size to maximize, we only show after maximize } mark('code/didMaximizeCodeWindow');
const viewContainerModel = this.viewDescriptorService.getViewContainerModel(viewContainer); state.push({ id: compositeItem.id, name: viewContainerModel.title, pinned: compositeItem.pinned, order: compositeItem.order, visible: compositeItem.visible }); placeholders.push({ id: compositeItem.id, name: this.getCompositeActions(compositeItem.id).activityAction.label }); <ins> } else { state.push({ id: compositeItem.id, name: compositeItem.name, pinned: compositeItem.pinned, order: compositeItem.order, visible: compositeItem.visible }); </ins> } }
import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycle'; import { IFileService, FileOperationError, FileOperationResult, IFileStatWithMetadata, ICreateFileOptions, IFileStreamContent } from 'vs/platform/files/common/files'; import { Disposable } from 'vs/base/common/lifecycle'; <ins> import { extname as pathExtname } from 'vs/base/common/path'; </ins> import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; import { IUntitledTextEditorService, IUntitledTextEditorModelManager } from 'vs/workbench/services/untitled/common/untitledTextEditorService'; import { UntitledTextEditorModel } from 'vs/workbench/services/untitled/common/untitledTextEditorModel';
import { Codicon } from 'vs/base/common/codicons'; import { listErrorForeground } from 'vs/platform/theme/common/colorRegistry'; import { withNullAsUndefined } from 'vs/base/common/types'; <ins> import { firstOrDefault } from 'vs/base/common/arrays'; </ins> /** * The workbench file service implementation implements the raw file service spec and adds additional methods on top.
} // Untitled without associated file path: use name <del> // of untitled model if it is a valid path name, // otherwise fallback to `basename`. let untitledName = model.name; if (!(await this.pathService.hasValidBasename(joinPath(defaultFilePath, untitledName), untitledName))) { untitledName = basename(resource); } // Add language file extension if specified const languageId = model.getLanguageId(); if (languageId && languageId !== PLAINTEXT_LANGUAGE_ID) { suggestedFilename = this.suggestFilename(languageId, untitledName); } else { suggestedFilename = untitledName; </del> <ins> // of untitled model if it is a valid path name and // figure out the file extension from the mode if any. if (await this.pathService.hasValidBasename(joinPath(defaultFilePath, model.name), model.name)) { const languageId = model.getLanguageId(); if (languageId && languageId !== PLAINTEXT_LANGUAGE_ID) { suggestedFilename = this.suggestFilename(languageId, model.name); } else { suggestedFilename = model.name; } </ins> } } }
suggestFilename(languageId: string, untitledName: string) { const languageName = this.languageService.getLanguageName(languageId); if (!languageName) { <del> return untitledName; </del> <ins> return untitledName; // unknown language, so we cannot suggest a better name </ins> } <del> const extension = this.languageService.getExtensions(languageId)[0]; if (extension) { if (!untitledName.endsWith(extension)) { return untitledName + extension; </del> <ins> const untitledExtension = pathExtname(untitledName); const extensions = this.languageService.getExtensions(languageId); if (extensions.includes(untitledExtension)) { return untitledName; // preserve extension if it is compatible with the mode } const primaryExtension = firstOrDefault(extensions); if (primaryExtension) { if (untitledExtension) { return `${untitledName.substring(0, untitledName.indexOf(untitledExtension))}${primaryExtension}`; </ins> } <ins> return `${untitledName}${primaryExtension}`; } const filenames = this.languageService.getFilenames(languageId); if (filenames.includes(untitledName)) { return untitledName; // preserve name if it is compatible with the mode </ins> } <del> const filename = this.languageService.getFilenames(languageId)[0]; return filename || untitledName; </del> <ins> return firstOrDefault(filenames) ?? untitledName; </ins> } //#endregion
registration.dispose(); }); <ins> test('Filename Suggestion - Preserve extension if it matchers', () => { const registration = accessor.languageService.registerLanguage({ id: 'plumbus2', extensions: ['.shleem', '.gazorpazorp'], }); const suggested = accessor.textFileService.suggestFilename('plumbus2', 'Untitled-1.gazorpazorp'); assert.strictEqual(suggested, 'Untitled-1.gazorpazorp'); registration.dispose(); }); test('Filename Suggestion - Rewrite extension according to language', () => { const registration = accessor.languageService.registerLanguage({ id: 'plumbus2', extensions: ['.shleem', '.gazorpazorp'], }); const suggested = accessor.textFileService.suggestFilename('plumbus2', 'Untitled-1.foobar'); assert.strictEqual(suggested, 'Untitled-1.shleem'); registration.dispose(); }); </ins> test('Filename Suggestion - Suggest filename if there are no extensions', () => { const registration = accessor.languageService.registerLanguage({ id: 'plumbus2',
assert.strictEqual(suggested, 'plumbus'); registration.dispose(); }); <ins> test('Filename Suggestion - Preserve filename if it matches', () => { const registration = accessor.languageService.registerLanguage({ id: 'plumbus2', filenames: ['plumbus', 'shleem', 'gazorpazorp'] }); const suggested = accessor.textFileService.suggestFilename('plumbus2', 'gazorpazorp'); assert.strictEqual(suggested, 'gazorpazorp'); registration.dispose(); }); test('Filename Suggestion - Rewrites filename according to language', () => { const registration = accessor.languageService.registerLanguage({ id: 'plumbus2', filenames: ['plumbus', 'shleem', 'gazorpazorp'] }); const suggested = accessor.textFileService.suggestFilename('plumbus2', 'foobar'); assert.strictEqual(suggested, 'plumbus'); registration.dispose(); }); </ins> });
} this._currentCommand.commandFinishedMarker = this._terminal.registerMarker(0); <del> const command = this._currentCommand.command; </del> <ins> let command = this._currentCommand.command; </ins> this._logService.debug('CommandDetectionCapability#handleCommandFinished', this._terminal.buffer.active.cursorX, this._currentCommand.commandFinishedMarker?.line, this._currentCommand.command, this._currentCommand); this._exitCode = exitCode;
} # Debug trapping/preexec inspired by starship (ISC) <del> __vsc_dbg_trap="$(trap -p DEBUG | cut -d' ' -f3 | tr -d ')" if [[ -z "$__vsc_dbg_trap" ]]; then </del> <ins> if [[ -n "${bash_preexec_imported:-}" ]]; then </ins> __vsc_preexec_only() { __vsc_status="$?" __vsc_preexec } <del> trap '__vsc_preexec_only "$_"' DEBUG elif [[ "$__vsc_dbg_trap" != '__vsc_preexec "$_"' && "$__vsc_dbg_trap" != '__vsc_preexec_all "$_"' ]]; then __vsc_preexec_all() { __vsc_status="$?" builtin eval ${__vsc_dbg_trap} __vsc_preexec } trap '__vsc_preexec_all "$_"' DEBUG </del> <ins> precmd_functions+=(__vsc_prompt_cmd) preexec_functions+=(__vsc_preexec_only) else __vsc_dbg_trap="$(trap -p DEBUG | cut -d' ' -f3 | tr -d ')" if [[ -z "$__vsc_dbg_trap" ]]; then __vsc_preexec_only() { __vsc_status="$?" __vsc_preexec } trap '__vsc_preexec_only "$_"' DEBUG elif [[ "$__vsc_dbg_trap" != '__vsc_preexec "$_"' && "$__vsc_dbg_trap" != '__vsc_preexec_all "$_"' ]]; then __vsc_preexec_all() { __vsc_status="$?" builtin eval ${__vsc_dbg_trap} __vsc_preexec } trap '__vsc_preexec_all "$_"' DEBUG fi </ins> fi __vsc_update_prompt
__vsc_original_prompt_command=${PROMPT_COMMAND[@]} fi <del> if [[ -n "$__vsc_original_prompt_command" && "$__vsc_original_prompt_command" != "__vsc_prompt_cmd" ]]; then PROMPT_COMMAND=__vsc_prompt_cmd_original else PROMPT_COMMAND=__vsc_prompt_cmd </del> <ins> if [[ -z "${bash_preexec_imported:-}" ]]; then if [[ -n "$__vsc_original_prompt_command" && "$__vsc_original_prompt_command" != "__vsc_prompt_cmd" ]]; then PROMPT_COMMAND=__vsc_prompt_cmd_original else PROMPT_COMMAND=__vsc_prompt_cmd fi </ins> fi
} __vsc_preexec() { <del> if [ "$__vsc_in_command_execution" = "0" ]; then __vsc_initialized=1 __vsc_in_command_execution="1" if [[ ! "$BASH_COMMAND" =~ ^__vsc_prompt* ]]; then __vsc_current_command=$BASH_COMMAND else __vsc_current_command="" fi __vsc_command_output_start </del> <ins> __vsc_initialized=1 if [[ ! "$BASH_COMMAND" =~ ^__vsc_prompt* ]]; then __vsc_current_command=$BASH_COMMAND else __vsc_current_command="" </ins> fi <ins> __vsc_command_output_start </ins> } # Debug trapping/preexec inspired by starship (ISC) if [[ -n "${bash_preexec_imported:-}" ]]; then __vsc_preexec_only() { <del> __vsc_status="$?" __vsc_preexec </del> <ins> if [ "$__vsc_in_command_execution" = "0" ]; then __vsc_in_command_execution="1" __vsc_preexec fi </ins> } precmd_functions+=(__vsc_prompt_cmd) preexec_functions+=(__vsc_preexec_only)
__vsc_dbg_trap="$(trap -p DEBUG | cut -d' ' -f3 | tr -d ')" if [[ -z "$__vsc_dbg_trap" ]]; then __vsc_preexec_only() { <del> __vsc_status="$?" __vsc_preexec </del> <ins> if [ "$__vsc_in_command_execution" = "0" ]; then __vsc_in_command_execution="1" __vsc_preexec fi </ins> } trap '__vsc_preexec_only "$_"' DEBUG elif [[ "$__vsc_dbg_trap" != '__vsc_preexec "$_"' && "$__vsc_dbg_trap" != '__vsc_preexec_all "$_"' ]]; then __vsc_preexec_all() { <del> __vsc_status="$?" builtin eval ${__vsc_dbg_trap} __vsc_preexec </del> <ins> if [ "$__vsc_in_command_execution" = "0" ]; then __vsc_in_command_execution="1" builtin eval ${__vsc_dbg_trap} __vsc_preexec fi </ins> } trap '__vsc_preexec_all "$_"' DEBUG fi