Skip to content

Editor launch fails if incorrect command is set in config

Currently, when Patchpal tries to run the configured editor command, the run_editor_fallible function is called. If this command (e.g., "terminal") is not found, glib::spawn_async fails, and run_editor_fallible returns an Err containing a string message like "No such file or directory". I consistently encounter an error when attempting to launch the external editor within the Patchpal GUI. The error dialog states, "Error running editor: Failed to execute child process "terminal" (No such file or directory)."

Screenshot_From_2025-07-02_15-35-43

This issue started after I intentionally (for testing purposes) entered an invalid command, "terminal", in the editor configuration popup. Now, even when opening Patchpal with new repositories, the error persists, and I am unable to change the editor settings to a valid one (like Vim, VS Code, etc.) through the GUI. This prevents any functionality that requires external editor interaction.

Further Observation: Even after closing and reopening Patchpal, or opening it with a different repository, the error persists, and the GUI does not provide an option to reconfigure the editor, effectively blocking core functionality.

Expected Behavior:

  • Patchpal should display a clear and helpful error message (e.g., "Editor command 'invalid_command' not found or executable. Please provide a valid path/command.").

  • Patchpal should then automatically re-open the editor configuration dialog, allowing the user to immediately correct the invalid entry. This would prevent the application from entering a broken state where editor functionality is unusable.