Skip to content

feat: add ExecCommand for running terminal subprocesses#6

Merged
marcoroth merged 2 commits intomarcoroth:mainfrom
DerekStride:exec-cmd
Mar 25, 2026
Merged

feat: add ExecCommand for running terminal subprocesses#6
marcoroth merged 2 commits intomarcoroth:mainfrom
DerekStride:exec-cmd

Conversation

@DerekStride
Copy link
Copy Markdown
Contributor

@DerekStride DerekStride commented Feb 25, 2026

What

Adds Bubbletea.exec(callable, message:) which suspends terminal management, runs a callable, then restores terminal state. This enables spawning editors, pagers, and other TUI subprocesses cleanly, similar to Go bubbletea's tea.Exec.

Testing

The tests in this project seem fairly early, I initially had mocks which I didn't love but we don't have a mock dependency so I used an object. It's not pretty but felt better than no tests. I didn't know if you had a plan for testing so kept this light. Let me know if you want me to make any improvements.

Copy link
Copy Markdown
Owner

@marcoroth marcoroth left a comment

Choose a reason for hiding this comment

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

Thank you @DerekStride, this looks great!

Yeah agreed, the testing story is not ideal yet. So far we have been mostly using the demos in the demo/ folder to test features. There's also a demo/exec demo that we might be able to update, now that we have a proper ExecCommand.

DerekStride and others added 2 commits February 26, 2026 10:48
Adds `Bubbletea.exec(callable, message:)` which suspends terminal
management, runs a callable, then restores terminal state. This enables
spawning editors, pagers, and other TUI subprocesses cleanly, similar to
Go bubbletea's `tea.Exec`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@DerekStride
Copy link
Copy Markdown
Contributor Author

Great! I added another commit to update the demo to use the new ExecCommand

Copy link
Copy Markdown
Owner

@marcoroth marcoroth left a comment

Choose a reason for hiding this comment

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

Great, thank you @DerekStride! 🙏🏼

@marcoroth marcoroth merged commit 2cb33d8 into marcoroth:main Mar 25, 2026
4 checks passed
@DerekStride DerekStride deleted the exec-cmd branch March 26, 2026 18:36
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.

2 participants