fix: force direct tty prompts for zsh hook#184
Merged
kaplanelad merged 1 commit intoMay 15, 2026
Conversation
kaplanelad
approved these changes
May 15, 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.
Summary
Fixes the zsh hook path so it explicitly uses Shellfirm's direct
/dev/ttyprompter instead of relying onstdin().is_terminal()to infer whether requestty/crossterm is safe.Root Cause
pre-commandalready has aDirectTtyPrompterfallback for zsh zle contexts, but it is selected only when stdin is not a terminal. In some zsh hook environments stdin still reports as a terminal, so Shellfirm selectsTerminalPrompter, enters requestty/crossterm, emits a cursor-position query, and can hang without showing a usable prompt.Changes
pre-command --direct-ttyflag that forcesDirectTtyPrompteron Unix.shellfirm pre-command --direct-tty -c "${BUFFER}".Fixes #183.
Verification
cargo test -p shellfirm zsh_hook_uses_direct_tty_promptcargo test -p shellfirm commandtarget/debug/shellfirm pre-command --direct-tty -c 'rm -rf /private/tmp/shellfirm-pr-runtime-test', confirming it showsType 'yes' to continueinstead of entering the hanging cursor-query path.