Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow to execute other things besides exec.Commands #280

Merged
merged 3 commits into from
Apr 4, 2022

Conversation

caarlos0
Copy link
Member

@caarlos0 caarlos0 commented Apr 4, 2022

This provides an interface around exec.Cmd so users can execute other things as well (i.e. any go code).

The main usecase for this that I see is for wishlist, so we can ssh into something and back to the list later instead of quitting everything :)

@caarlos0 caarlos0 added the enhancement New feature or request label Apr 4, 2022
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
@caarlos0 caarlos0 merged commit d18daff into exec-cancelreader Apr 4, 2022
@caarlos0 caarlos0 deleted the exec-interface branch April 4, 2022 19:43
muesli pushed a commit that referenced this pull request Apr 5, 2022
* feat: allow to execute other things besides exec.Commands.

* fix: lint issues

* fix: renames, examples

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
meowgorithm added a commit that referenced this pull request Apr 12, 2022
…rminal (#237)

* add: program.ReleaseTerminal and RestoreTerminal to re-use input & terminal

* chore(examples): add altscreen toggling to exec demo

* chore: put low-level altscreen stuff alongside other screen funcs

* docs: edit GoDocs for ReleaseTerminal and RestoreTerminal

* feat(renderer): add internal Msg renderMsg to immediately repaint

* fix: repaint instantly on RestoreTerminal

* fix: restore the altscreen state when restoring the terminal

* feat: implement Cmd-based API for blocking *exec.Cmds

* feat: allow Exec to return custom messages

* feat: allow Exec to be run without a callback

* fix: separate parameters for exec.Command examples

* fix: error message would get printed over by prompt in exec example

* fix: ignore signals while child process is running

* feat: allow to execute other things besides exec.Commands (#280)

* feat: allow to execute other things besides exec.Commands.

* fix: lint issues

* fix: renames, examples

* fix: callback type should be exported

* docs(exce): tiny ExecCommand doc comment correction

* chore(exec): break out Cmd for clarity's sake in example

* fix(exec): give the terminal a moment to catch up if exiting altscreen

* docs(exec): tidy up doc comments

* chore(exec): disambiguate methods for restoring the terminal state vs input

Co-authored-by: Christian Rocha <christian@rocha.is>
Co-authored-by: Carlos A Becker <caarlos0@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant