Skip to content

feat(tui): easily retry failed commands#12926

Merged
davidpdrsn merged 1 commit intomasterfrom
dp/retry-failed-commands
Mar 19, 2026
Merged

feat(tui): easily retry failed commands#12926
davidpdrsn merged 1 commit intomasterfrom
dp/retry-failed-commands

Conversation

@davidpdrsn
Copy link
Contributor

@davidpdrsn davidpdrsn commented Mar 19, 2026

If you ran a command in the TUI, and it failed, it would be discarded.
That made it tedious to retry.

This fixes that so if the command failed you stay in command mode with
the previous command in the input. That way you can easily tweak it and
try again.


If you ran a command in the TUI, and it failed, it would be discarded.
That made it tedious to retry.

This fixes that so if the command failed you stay in command mode with
the previous command in the input. That way you can easily tweak it and
try again.
@vercel
Copy link

vercel bot commented Mar 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
gitbutler-web Ignored Ignored Mar 19, 2026 9:53am

Request Review

@github-actions github-actions bot added rust Pull requests that update Rust code CLI The command-line program `but` labels Mar 19, 2026
@davidpdrsn davidpdrsn marked this pull request as ready for review March 19, 2026 09:53
Copilot AI review requested due to automatic review settings March 19, 2026 09:53
Base automatically changed from dp/insert-commits-above-or-below to master March 19, 2026 09:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the but legacy status TUI command mode UX by keeping the user in command mode (with the previous command preserved) when a command fails, making it easy to tweak and retry.

Changes:

  • Update command execution flow to only return to normal mode on success; on failure, show a transient error and keep command input intact.
  • Add a focused test module for command mode behavior and new snapshots covering success and failure scenarios.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/but/src/command/legacy/status/tui/mod.rs Keep command mode active on non-zero exit and show a transient error; factor out prompt + exit-status formatting.
crates/but/src/command/legacy/status/tui/tests/mod.rs Register new command_tests module.
crates/but/src/command/legacy/status/tui/tests/command_tests.rs Add tests asserting command-mode success returns to normal and failures preserve the input.
crates/but/src/command/legacy/status/tui/tests/snapshots/command_mode_success_001.txt Snapshot: entering command mode with initial input.
crates/but/src/command/legacy/status/tui/tests/snapshots/command_mode_success_002.txt Snapshot: command mode with typed args.
crates/but/src/command/legacy/status/tui/tests/snapshots/command_mode_success_003.txt Snapshot: post-success returns to normal mode.
crates/but/src/command/legacy/status/tui/tests/snapshots/command_mode_failure_001.txt Snapshot: non-zero exit shows error popup while retaining command input.

You can also share your feedback on Copilot code review. Take the survey.

@davidpdrsn davidpdrsn enabled auto-merge March 19, 2026 10:01
@davidpdrsn davidpdrsn merged commit 2babbee into master Mar 19, 2026
38 checks passed
@davidpdrsn davidpdrsn deleted the dp/retry-failed-commands branch March 19, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLI The command-line program `but` rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants