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

Feature request: start shell in same terminal window #83

Closed
daanbeverdam opened this issue Dec 4, 2018 · 8 comments
Closed

Feature request: start shell in same terminal window #83

daanbeverdam opened this issue Dec 4, 2018 · 8 comments
Assignees

Comments

@daanbeverdam
Copy link

Right now when starting a shell for a docker container, the dockerRunScript.sh is launched in a new tab/window. Is it possible to have this script open in the same window (possibly integrated within the Dockly interface)? If you could give me some pointers on how to do this, I'll be more than happy to make a pull request.

@lirantal lirantal self-assigned this Dec 4, 2018
@lirantal
Copy link
Owner

lirantal commented Dec 4, 2018

@daanbeverdam thanks for chiming in and happy to hear dockly is helpful for you.

To make that happen it will require to current running shell command (dockly itself) to terminate and spawn a new command to connect to the container on the same shell. Upon exiting the command it will re-spawn dockly so you can go back and continue. Could work but sounds a bit qwarky no?

Another option is to embed an actuall shell through JS inside the dockly interface but sounds like a ton of work and not really worth it in terms of the effort, maintenance and dependencies it will require.

Happy to hear more thoughts on this though.

@daanbeverdam
Copy link
Author

Thanks for your reply (and sorry for my late one)! True, the embedded shell sounds like too much effort for a feature this small. For me, it would be fine to 'lose' the Dockly instance and not have it come back up after I exit the container's shell. Doesn't feel more hacky to me than opening it in a new tab, but our opinions may differ on that.

Would you consider merging if I'd implement it that way?

@lirantal
Copy link
Owner

I love the pro-activeness spirit!

I'm happy to merge it if you can make it happen.
Would like to think however how would we call it (i.e shortcuts system today) and thinking maybe it can be a config flag (say an environment variable) where the default is to keep existing functionality as is today?

@daanbeverdam
Copy link
Author

Great! Yeah, seems like a good idea. I'll look into it when I can find the time and keep you posted!

@lirantal
Copy link
Owner

Sounds great!

@triforcely
Copy link
Collaborator

triforcely commented Feb 13, 2019

Hey! I created PoC for this feature

integrated-shell

It basically freezes blessedjs (because of execSync), clears console and executes docker command. After interactive console is exitted, console is cleared and blessedjs is forced to redraw whole screen - blessedjs keeps track of changes but my stdio magic causes it to get out of sync. Standard streams are seamlessly inheritted, so it should theoretically work in any terminal and OS - even through SSH. Application is never closed, so application state is untouched. Also, there is no need for separate *.sh script (or Windows equivalent)

It works fine on Windows 10 and mostly on ubuntu but I'm unable to run docker inside docker (😅), so some help with testing would be appreciated!

Could you help me with testing if it works on linux?

@lirantal
Copy link
Owner

Woah great job @triforcely! 🔥
I can help test it on Mac, Linux and inside a docker container.

@lirantal
Copy link
Owner

Fixed by #97

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants