Expose the effective shell executable and dialect in shell execution hooks

Feature request for product/service

Cursor IDE

Describe the request

Could Cursor include the effective shell executable and dialect in beforeShellExecution, and in preToolUse when the tool is Shell? Both hooks should identify the shell that will actually interpret the pending command, including any selection or fallback performed by Cursor.

I use Cursor IDE on native Windows and want to build deterministic command guards based on syntactic and semantic analysis. My main goal is reproducibility and testability: given the same command, execution context, and policy, I want to reproduce the decision and verify it with regression tests.

Quoting, escaping, and command chaining follow different rules across shells. A guard therefore needs the actual shell dialect to identify command boundaries and arguments correctly. The command text alone, or the shell running the hook script, is not enough.

Specifically, I’m considering nah for these guards. Its Cursor guidance describes a limitation on Windows: when the payload does not identify the shell dialect, nah keeps the command partially analyzed and delegates without shell effects.

The Cursor Hooks documentation shows command, cwd, and sandbox for beforeShellExecution, but does not document shell identification. This request is based on the published documentation; I have not yet verified the raw payload from my own installation.

For reference, Codex issue #44836 requests similar execution-resolved shell metadata. It is a related design discussion, rather than evidence about Cursor’s implementation.

Is there already a supported way for these hooks to obtain this information? If so, a documentation pointer would help. If not, please consider adding it to both hook inputs.

Operating System (if it applies)

Windows 10/11