-
Notifications
You must be signed in to change notification settings - Fork 527
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
Exec Sh Feature #151
Exec Sh Feature #151
Conversation
This PR only works if the user has Docker on their local machine + the target container contains A much more acceptable approach would be implementing an arbitrary container |
feature: hot key for "exec sh"
@bcicen ok, I'll try a bit later. Anyway it works for my case :) |
executing the default shell is already a great step forward! 👍 |
@bcicen I used API for executing but left |
menus.go
Outdated
|
||
ui.DefaultEvtStream.ResetHandlers() | ||
defer ui.DefaultEvtStream.ResetHandlers() | ||
ui.StopLoop() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StopLoop()
and Loop()
are already handled when a menu is selected from Display()
, so not necessary here
Looking much better! Rather than forcing a default shell globally for all containers, it might make more sense to make this a generic |
Good idea. I'll do it. BTW there are still some artifacts with terminal rendering through direct stdout. I'm trying to solve it. |
FYI, after making some updates to handle potentially empty frames when first attached, I've merged your branch here. Thanks again! |
It still has artifacts. I don't think that this feature is ready for production. Artifacts which I found:
|
screen resizing might be difficult without stopping termui entirely -- if possible, it might be ideal to close and reopen std{out,in} descriptors when entering and leaving each exec session, re-initializing termui entirely |
in addition to artifacts, most combination key presses are being filtered from the stdin stream as well. The above mentioned solution of handing full stream control over to the exec thread is likely the only option that will handle all the edge cases that come with subprocess shell usage. |
Demo:
https://youtu.be/6YJuKxVKi2s
Fixes #56