Change:
<!-- Do Not Delete This! bugreporttemplate --<!-- Please read our Rules of Conduct: --<!-- Read our guide about submitting issues: --<!-- Search existing issues to avoid creating duplicates. --<!-- Test using the latest Insiders build to see if your issue has already been fixed: --<!-- Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. --<!-- Launch with to check. --Does this issue occur when all extensions are disabled?: Yes (It's happening for fresh installation) <!-- If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. --<!-- Issues caused by an extension need to be reported directly to the extension publisher. The 'Help Report Issue' dialog can assist with this. --- VS Code Version: 1.85.1 OS Version: Macbook M1 Pro - Sonoma 14.2.1 Steps to Reproduce: VSCode Darwin build from downloads page - (Mac .zip Apple Silicon) Shell command: Install 'code' command in PATH cancel for the below prompt <img width="1136" alt="Screenshot 2024-01-02 at 7 35 58 PM" src=""It should display that shell command was not completed successfully. Instead it shows command successfully <img width="1136" alt="Screenshot 2024-01-02 at 7 38 19 PM" src=""

Discussion:
import { IV8Profile } from 'vs/platform/profiling/common/profiling'; import { IAuxiliaryWindowsMainService, isAuxiliaryWindow } from 'vs/platform/auxiliaryWindow/electron-main/auxiliaryWindows'; import { IAuxiliaryWindow } from 'vs/platform/auxiliaryWindow/electron-main/auxiliaryWindow'; <ins> import { CancellationError } from 'vs/base/common/errors'; </ins> export interface INativeHostMainService extends AddFirstParameterToFunctions<ICommonNativeHostService, Promise<unknown> /* only methods, not events */, number | undefined /* window ID */> { }

] }); <del> if (response === 0 /* OK */) { try { const command = `osascript -e "do shell script "mkdir -p /usr/local/bin && ln -sf '${target}' '${source}'" with administrator privileges"`; await promisify(exec)(command); } catch (error) { throw new Error(localize('cantCreateBinFolder', "Unable to install the shell command '{0}'.", source)); } </del> <ins> if (response === 1 /* Cancel */) { throw new CancellationError(); } try { const command = `osascript -e "do shell script "mkdir -p /usr/local/bin && ln -sf '${target}' '${source}'" with administrator privileges"`; await promisify(exec)(command); } catch (error) { throw new Error(localize('cantCreateBinFolder', "Unable to install the shell command '{0}'.", source)); </ins> } } }

] }); <del> if (response === 0 /* OK */) { try { const command = `osascript -e "do shell script "rm '${source}'" with administrator privileges"`; await promisify(exec)(command); } catch (error) { throw new Error(localize('cantUninstall', "Unable to uninstall the shell command '{0}'.", source)); } </del> <ins> if (response === 1 /* Cancel */) { throw new CancellationError(); } try { const command = `osascript -e "do shell script "rm '${source}'" with administrator privileges"`; await promisify(exec)(command); } catch (error) { throw new Error(localize('cantUninstall', "Unable to uninstall the shell command '{0}'.", source)); </ins> } break; }

import { INativeHostService } from 'vs/platform/native/common/native'; import { toErrorMessage } from 'vs/base/common/errorMessage'; import { IProductService } from 'vs/platform/product/common/productService'; <ins> import { isCancellationError } from 'vs/base/common/errors'; </ins> const shellCommandCategory: ILocalizedString = { value: localize('shellCommand', "Shell Command"), original: 'Shell Command' };

dialogService.info(localize('successIn', "Shell command '{0}' successfully installed in PATH.", productService.applicationName)); } catch (error) { <ins> if (isCancellationError(error)) { return; } </ins> dialogService.error(toErrorMessage(error)); } }

dialogService.info(localize('successFrom', "Shell command '{0}' successfully uninstalled from PATH.", productService.applicationName)); } catch (error) { <ins> if (isCancellationError(error)) { return; } </ins> dialogService.error(toErrorMessage(error)); } }