-
Notifications
You must be signed in to change notification settings - Fork 78
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: add wish.Command and wish.Cmd #229
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The wish-exec example with vim worked because neovim was not using STDERR. Bubbletea doesn't have a concept of stdout and stderr, just output, so `tea.ExecProcess` sets the `exec.Cmd` stderr to `os.Stderr`. This would fail for bash, for instance. This also introduces a `wish.Cmd` type and a `wish.Command` function to properly set up a `wish.Cmd` based on `ssh.Session` (and optionally a Pty), which can then be used with `tea.Exec`. Finally, it adds to the wish-exec example, including the `s` key to run a shell (bash). closes #228 Signed-off-by: Carlos Alexandro Becker <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #229 +/- ##
==========================================
+ Coverage 76.58% 77.23% +0.64%
==========================================
Files 17 19 +2
Lines 914 940 +26
==========================================
+ Hits 700 726 +26
Misses 160 160
Partials 54 54 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Carlos Alexandro Becker <[email protected]>
Signed-off-by: Carlos Alexandro Becker <[email protected]>
Signed-off-by: Carlos Alexandro Becker <[email protected]>
Signed-off-by: Carlos Alexandro Becker <[email protected]>
Signed-off-by: Carlos Alexandro Becker <[email protected]>
ghthor
reviewed
Jan 22, 2024
Signed-off-by: Carlos Alexandro Becker <[email protected]>
Signed-off-by: Carlos Alexandro Becker <[email protected]>
ghthor
reviewed
Jan 22, 2024
* fix: create a new pty for exec.Cmd Signed-off-by: Carlos Alexandro Becker <[email protected]> * fix: improvements * fix: test * fix: windows Signed-off-by: Carlos Alexandro Becker <[email protected]> * fix: unneeded err Signed-off-by: Carlos Alexandro Becker <[email protected]> * fix Signed-off-by: Carlos Alexandro Becker <[email protected]> * fix: resize && race Signed-off-by: Carlos Alexandro Becker <[email protected]> * fix: windows/linux Signed-off-by: Carlos Alexandro Becker <[email protected]> * test: ignore on windows for now Signed-off-by: Carlos Alexandro Becker <[email protected]> * fix: sync Signed-off-by: Carlos Alexandro Becker <[email protected]> * test: hammer Signed-off-by: Carlos Alexandro Becker <[email protected]> * chore: import --------- Signed-off-by: Carlos Alexandro Becker <[email protected]>
Signed-off-by: Carlos Alexandro Becker <[email protected]>
aymanbagabas
approved these changes
Jan 30, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The wish-exec example with vim worked because neovim was not using
STDERR.
Bubbletea doesn't have a concept of stdout and stderr, just output, so
tea.ExecProcess
sets theexec.Cmd
stderr toos.Stderr
.This would fail for bash, for instance.
This also introduces a
wish.Cmd
type and awish.Command
function to properly set up a
wish.Cmd
based onssh.Session
(andoptionally a Pty), which can then be used with
tea.Exec
.Finally, it adds to the wish-exec example, including the
s
key to runa shell (bash).
closes #228