Skip to content

fix: use interactive exec for custom command execution#3493

Open
amitksingh1490 wants to merge 2 commits into
mainfrom
fix/custom-command-interactive-exec
Open

fix: use interactive exec for custom command execution#3493
amitksingh1490 wants to merge 2 commits into
mainfrom
fix/custom-command-interactive-exec

Conversation

@amitksingh1490

Copy link
Copy Markdown
Contributor

Summary

Fix custom command execution to use interactive exec, ensuring proper terminal handling when running custom commands through the shell plugin.

Context

When executing custom commands via the shell plugin's dispatcher (:command syntax), the _forge_exec function was being used instead of _forge_exec_interactive. This meant custom commands were missing interactive terminal capabilities (like proper pty handling, signal forwarding, and real-time output streaming) that are already present for default agent execution at dispatcher.zsh:82.

Changes

  • Replaced _forge_exec calls with _forge_exec_interactive in the custom command branch of _forge_action_default
  • Applies to both the case with input text and without input text

Key Implementation Details

The _forge_exec_interactive function provides a proper interactive terminal session with pty support, while _forge_exec is a simpler non-interactive execution. Custom commands benefit from the same interactive capabilities as the default agent path, which already uses _forge_exec_interactive.

Testing

# Source the updated shell plugin
source shell-plugin/lib/dispatcher.zsh

# Run a custom command (requires a custom command to be defined)
# Verify output streams properly with real-time display
:my-custom-command some input text

# Verify without input text
:my-custom-command

Replace _forge_exec with _forge_exec_interactive in custom command
dispatcher path to ensure custom commands get proper interactive
terminal handling, consistent with the default agent execution path.
@github-actions github-actions Bot added the type: fix Iterations on existing features or infrastructure. label Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix Iterations on existing features or infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant