# Expose the effective shell executable and dialect in shell execution hooks

**URL:** <https://forum.cursor.com/t/expose-the-effective-shell-executable-and-dialect-in-shell-execution-hooks/173695>\
**Category:** Feature Requests\
**Tags:** terminal, windows, hooks\
**Created:** [October 4, 2026, 1:40am UTC](https://forum.cursor.com/t/expose-the-effective-shell-executable-and-dialect-in-shell-execution-hooks/173695 "2026-10-04T01:40:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alker](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/alker/32/122640_2.png) [@Alker](https://forum.cursor.com/u/Alker)\
**Post date:** [October 4, 2026, 1:40am UTC](https://forum.cursor.com/t/expose-the-effective-shell-executable-and-dialect-in-shell-execution-hooks/173695/1 "2026-10-04T01:40:29Z")

</div>

### 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](https://nahguard.ai/docs/runtimes/cursor/) 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](https://github.com/openai/codex/issues/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
