Skip to content

Conversation

@RomneyDa
Copy link
Collaborator

@RomneyDa RomneyDa commented Sep 3, 2025

Description

Adds a "shell mode" that users can enter using "!". Runs as a Bash tool invocation for now.

image image image image

CON-3795


Summary by cubic

Add a shell mode to the CLI: start input with "!" to run shell commands directly from the chat with instant tool-call feedback. Addresses CON-3345 by enabling quick terminal commands without leaving the TUI.

  • New Features
    • Input starting with "!" enters shell mode; on submit it strips "!" and runs the command as a Bash tool, showing an assistant message immediately with status updates.
    • UI cues: yellow border and "$" prompt; placeholder mentions "!"; Esc clears when the input is only "!".
    • Disables "@" file search and "/" slash commands while active; help text updated to include "! usage".
    • Execution: uses user's login shell on Unix or PowerShell on Windows; runs in cwd, inherits env, stdin detached to avoid TTY blocking.
    • Added spec docs and unit tests for useChat; updated spawn options in runTerminalCommand.

@RomneyDa RomneyDa requested a review from a team as a code owner September 3, 2025 02:19
@RomneyDa RomneyDa requested review from tingwai and removed request for a team September 3, 2025 02:19
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Sep 3, 2025
@github-actions
Copy link

github-actions bot commented Sep 3, 2025

⚠️ AI review completed but no review output was generated. Check the action logs for details.


💡 To request a new review, comment @continue-general-review

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

11 issues found across 8 files

React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai to give feedback, ask questions, or re-run the review.

} catch (error: any) {
const errorMessage = `Bash command failed: ${error?.message || String(error)}`;
services.chatHistory.addToolResult(toolCallId, errorMessage, "error");
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bash execution lacks a cancellation path; command continues running after user interrupt, leading to orphaned processes and inconsistent UI state

Prompt for AI agents
Address the following comment on extensions/cli/src/ui/hooks/useChat.ts at line 374:

<comment>Bash execution lacks a cancellation path; command continues running after user interrupt, leading to orphaned processes and inconsistent UI state</comment>

<file context>
@@ -339,6 +339,52 @@ export function useChat({
+    services.chatHistory.updateToolStatus(toolCallId, &quot;calling&quot;);
+
+    // Execute the bash command asynchronously - don&#39;t block UI
+    (async () =&gt; {
+      try {
+        const { runTerminalCommandTool } = await import(&quot;../../tools/runTerminalCommand.js&quot;);
</file context>

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took a pass at this but decided worth doing on another PR. have opened a linear ticket for it

@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Sep 3, 2025
@chezsmithy
Copy link
Contributor

This would be a great feature for the vscode and IntelliJ extensions as well. Save having to use the terminal and then pull the context back in using @Terminal.

Copy link
Contributor

@tingwai tingwai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tested locally, love it!

@github-project-automation github-project-automation bot moved this from Todo to In Progress in Issues and PRs Sep 5, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 5, 2025
@tingwai tingwai merged commit d883de8 into main Sep 5, 2025
60 of 74 checks passed
@tingwai tingwai deleted the dallin/con-3345 branch September 5, 2025 20:40
@github-project-automation github-project-automation bot moved this from In Progress to Done in Issues and PRs Sep 5, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Sep 5, 2025
@github-actions github-actions bot added the tier 2 Important feature that adds new capabilities to the platform or improves critical user journeys label Sep 5, 2025
@sestinj
Copy link
Contributor

sestinj commented Sep 11, 2025

🎉 This PR is included in version 1.13.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm This PR has been approved by a maintainer released size:XL This PR changes 500-999 lines, ignoring generated files. tier 2 Important feature that adds new capabilities to the platform or improves critical user journeys

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants