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

suggestion: option to reuse terminals #251

Closed
chrisdias opened this issue Apr 18, 2018 · 11 comments · Fixed by #2173
Closed

suggestion: option to reuse terminals #251

chrisdias opened this issue Apr 18, 2018 · 11 comments · Fixed by #2173

Comments

@chrisdias
Copy link
Member

There is no API to let me see if a terminal is in use, so whenever a command is run we spin up a new terminal. This leads to a bunch of unused terminals to clean up.

Suggest to investigate an option that reuses the same terminal, commands are effectively queued up.

@wsmelton
Copy link

Might check docker-explorer as they reuse terminal sessions in that extension. It seems like they pick up what the terminal is named and simply reference that to find the right terminal to use...but I don't claim to know how extensions are written 😀

@PrashanthCorp
Copy link
Contributor

Is this a dupe of #74 ?

@StephenWeatherford
Copy link
Contributor

Consider a flag as to whether or not to show a new terminal. But it might depend on the command, e.g.:

Run Interactive
Run
Show Logs
Build

Might need more thinking.

@StephenWeatherford
Copy link
Contributor

Or experimenting

@StephenWeatherford StephenWeatherford added this to the 0.5.0 milestone Sep 21, 2018
@ejizba ejizba modified the milestones: 0.7.0, 0.8.0 Jun 18, 2019
@bwateratmsft
Copy link
Collaborator

Resolved by #1245

@ejizba
Copy link
Contributor

ejizba commented Sep 16, 2019

@bwateratmsft are you sure you closed the right issue here? This issue covers several features as mentioned above in Stephen's comment including compose, run, push image, pull image, view logs, etc. Basically anything that uses this

@ejizba ejizba reopened this Sep 16, 2019
@bwateratmsft
Copy link
Collaborator

Sorry, I was thinking about build which is resolved. But the rest would not be.

@bwateratmsft
Copy link
Collaborator

Alex's suggestion was to create a Task object dynamically, and then execute it. This would result in terminals being re-used (most of the time), but for things like run-interactive, where a task stays running, the Task would automatically open a new terminal. Which is awesome!

@bwateratmsft
Copy link
Collaborator

bwateratmsft commented May 13, 2020

There are some major challenges to this approach with regard to shell quoting. Most of the commands work just fine, but attach is broken on PowerShell. The default command is docker exec -it abc123 /bin/sh -c "[ -e /bin/bash ] && /bin/bash || /bin/sh". In a terminal window this works fine, but when run as a ShellExecution, the command essentially becomes powershell -c 'docker exec -it abc123 /bin/sh -c "[ -e /bin/bash ] && /bin/bash || /bin/sh"', which does not work; the double-quotes are unescaped and the shell gets confused.

I think it's safe to change the default value for docker.attachShellCommand.linuxContainer as there are only ~12 users worldwide who appear to have a non-default command, compared to >19K with the default.

@bwateratmsft
Copy link
Collaborator

Blocked on #1980.

@bwateratmsft bwateratmsft removed this from the 1.3.0 milestone May 14, 2020
@bwateratmsft bwateratmsft added this to the 1.4.0 milestone May 14, 2020
@bwateratmsft bwateratmsft modified the milestones: 1.4.0, 1.5.0 Jun 16, 2020
@bwateratmsft bwateratmsft removed their assignment Jul 20, 2020
@vscodebot vscodebot bot locked and limited conversation to collaborators Sep 3, 2020
@bwateratmsft
Copy link
Collaborator

This has been fixed in Docker extension version 1.5.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
7 participants