divnix / std

A DevOps framework for the SDLC with the power of Nix and Flakes. Good for keeping deadlines!
https://std.divnix.com
399 stars 43 forks source link

`std` Action run leave terminal 'stale' #57

Closed blaggacao closed 2 years ago

blaggacao commented 2 years ago

Terminal needs reset after an action run.

The immediate and brutal use of execve might not be the best strategy.

Rather we should let tea to tea.Quit itself properly and only then execve

blaggacao commented 2 years ago

/ cc @meowgorithm & @toby

I had been looking for a way to keep tea from redrawing until esc is hit after running https://github.com/charmbracelet/bubbletea/blob/master/examples/exec/main.go

That exec otherwise works beautifully. But if an output of on of our actions here is just printing something to stdout, then we must at least give the user time to appreciate that output.

Maybe you can help?

meowgorithm commented 2 years ago

@blaggacao Ah, are you saying that Bubble Tea is still responding to messages (and hence forcing a render) while your exec is still running? If that's the case then you have found a bug (which I'm keen to patch). Let me know.

blaggacao commented 2 years ago

@meowgorithm No. I have a potential different use case:

That way, we can run a command, show it's output, let the user copy paste some logs somewhere, and when done, return to the TUI.

Thanks for chiming in!

meowgorithm commented 2 years ago

That's a totally reasonable request (and a good feature). In terms of actual implementation, how about if we do it like this?

blaggacao commented 2 years ago

@meowgorithm sounds perfect! And sorry for speccing this out here on foreign soil. 😬