Skip to content

Let a derived tool inherit useShellExecute - #799

Merged
SimonCropp merged 1 commit into
mainfrom
fix-addtoolbasedon-shellexecute
Aug 22, 2026
Merged

Let a derived tool inherit useShellExecute#799
SimonCropp merged 1 commit into
mainfrom
fix-addtoolbasedon-shellexecute

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

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.

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.
@SimonCropp SimonCropp added this to the 20.0.0 milestone Aug 22, 2026
@SimonCropp
SimonCropp merged commit 86076b9 into main Aug 22, 2026
10 checks passed
@SimonCropp
SimonCropp deleted the fix-addtoolbasedon-shellexecute branch August 22, 2026 02:49
This was referenced Aug 26, 2026
This was referenced Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant