Let a derived tool inherit useShellExecute - #799
Merged
Conversation
Every optional flag on AddToolBasedOn is a nullable that falls back to the tool being derived from - except useShellExecute, which defaulted to true. So its `?? existing.UseShellExecute` was unreachable, and a caller who said nothing about it did not inherit: they got true. Five definitions set it false, and they are the ones where it matters: the bundled viewer, VS Code, Cursor, MsWordDiff and MsExcelDiff. Deriving from any of them silently changed how the tool launches, and took the inherited CreateNoWindow with it - which on the viewer is the console flash the definition exists to prevent. The test asserts the defaults rather than deriving a tool, and that is deliberate. AddToolBasedOn resolves through ToolLookup, so it only works for a tool actually installed on the machine, and the viewer resolves on neither this machine nor CI - I wrote the behavioural version first and it passed against the bug, because it was taking its own early return. Asserting that every bool? flag defaults to null pins the real contract and fails without the fix.
This was referenced Aug 26, 2026
This was referenced Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every optional flag on AddToolBasedOn is a nullable that falls back to the tool
being derived from - except useShellExecute, which defaulted to true. So its
?? existing.UseShellExecutewas unreachable, and a caller who said nothingabout it did not inherit: they got true.
Five definitions set it false, and they are the ones where it matters: the
bundled viewer, VS Code, Cursor, MsWordDiff and MsExcelDiff. Deriving from any
of them silently changed how the tool launches, and took the inherited
CreateNoWindow with it - which on the viewer is the console flash the definition
exists to prevent.
The test asserts the defaults rather than deriving a tool, and that is
deliberate. AddToolBasedOn resolves through ToolLookup, so it only works for a
tool actually installed on the machine, and the viewer resolves on neither this
machine nor CI - I wrote the behavioural version first and it passed against the
bug, because it was taking its own early return. Asserting that every bool? flag
defaults to null pins the real contract and fails without the fix.