Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

Win32Exception when the default editor is set to something that doesn't exist #213

@tlmii

Description

@tlmii

The user will see a Win32Exception bubble up to them if they've set the default editor to something that doesn't exist:

System.ComponentModel.Win32Exception (2): The system cannot find the file specified.
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at Microsoft.HttpRepl.Commands.BaseHttpCommand.HandleRequiresBody(DefaultCommandInput`1 commandInput, IShellState shellState, HttpState programState, HttpRequestMessage request, Dictionary`2 requestHeaders) in /_/src/Microsoft.HttpRepl/Commands/BaseHttpCommand.cs:line 224
   at Microsoft.HttpRepl.Commands.BaseHttpCommand.ExecuteAsync(IShellState shellState, HttpState programState, DefaultCommandInput`1 commandInput, ICoreParseResult parseResult, CancellationToken cancellationToken) in /_/src/Microsoft.HttpRepl/Commands/BaseHttpCommand.cs:line 122
   at Microsoft.Repl.Commanding.DefaultCommandDispatcher`2.ExecuteCommandInternalAsync(IShellState shellState, CancellationToken cancellationToken) in /_/src/Microsoft.Repl/Commanding/DefaultCommandDispatcher.cs:line 150
   at Microsoft.Repl.Commanding.DefaultCommandDispatcher`2.ExecuteCommandAsync(IShellState shellState, CancellationToken cancellationToken) in /_/src/Microsoft.Repl/Commanding/DefaultCommandDispatcher.cs:line 113

A common way that this might be hit is if they try to just set the editor to code since that's what they'd issue at the command line to open VS Code:

pref set editor.command.default code

That won't work - they need to put in the full path. But that's just an example. We should give a better message to the user and not just throw out the Win32Exception here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions