Skip to content

Conversation

@meowgorithm
Copy link
Member

@meowgorithm meowgorithm commented Nov 2, 2025

This is a series of small-ish improvements to crush run. The main things are:

  • There were extra newlines printing above the output. Now they're gone.
  • There was no newline printing at the end of the output, which meant the prompt would print over the output after exit. That is fixed.

Other things to do in another pass:

  • Run the spinner on stderr
  • Make this work with pipes when output is not stdout and input is a pipe, i.e.
    • crush run "What is this?" <<< main.go > output.txt
    • curl https://charm.land | crush run "What is this?" > output.txt

@meowgorithm meowgorithm requested a review from a team as a code owner November 2, 2025 14:35
@meowgorithm meowgorithm changed the title Crush run Various crush run improvements Nov 2, 2025
Copy link
Member

@andreynering andreynering left a comment

Choose a reason for hiding this comment

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

Seems solid!

As a little extra thing, if you want to take a look while you're at it: the Generating... text is a little hard to read when using the terminal light mode.

Comment on lines +179 to +206
// HACK: Reinitialize the terminal progress bar on every iteration so
// it doesn't get hidden by the terminal due to inactivity.
_, _ = fmt.Printf(ansi.SetIndeterminateProgressBar)
Copy link
Member

Choose a reason for hiding this comment

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

Does this cause the some bugs on iTerm2/SSH that #1329 fixed for interactive?

If so, we might want to address them.

/cc @aymanbagabas

Copy link
Member Author

Choose a reason for hiding this comment

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

Fwiw this was a present prior to this PR and lives in many places around the codebase.

@meowgorithm
Copy link
Member Author

Seems solid!

As a little extra thing, if you want to take a look while you're at it: the Generating... text is a little hard to read when using the terminal light mode.

Oh wow, I didn't realize that was hard-coded to light grey; will fix prior to merging. Thanks for the detailed review!

@meowgorithm
Copy link
Member Author

Alright, fixed for you @andreynering.

Copy link
Member

@andreynering andreynering left a comment

Choose a reason for hiding this comment

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

Looks great!

@meowgorithm meowgorithm merged commit 3398577 into main Nov 3, 2025
17 checks passed
@meowgorithm meowgorithm deleted the crush-run branch November 3, 2025 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants