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

Temporary env is not removed if terminal is not properly exited #188

Open
AlexandreDecan opened this issue Mar 27, 2018 · 2 comments
Open

Comments

@AlexandreDecan
Copy link
Contributor

If a temporary environment is created using pew mktmpenv, it has to be properly exited (e.g. using either exit or CTRL+D) for the environment to be removed.

If the terminal is "improperly closed" (e.g. by using the "close window" icon), then the temporary environment is not removed and must be manually removed (and that's not always easy without autocompletion given the name they can have! ;-))

I realised this when I discovered more than 20 temporary environments with pew ls...
Is there something that can be done about this? I don't think it's easy to detect that a temporary environment is not used anymore, but we can maybe warn the user when a new temporary environment is created that existing ones are still there?

@berdario
Copy link
Collaborator

Yeah, I guess that we could print a warning.

for this purpose, we'd probably have to pick a new naming convention (which would also help to delete them), to quickly list them.

Maybe that another possibility would be to overwrite WORKON_HOME with the system temporary directory. That way (usually upon reboot), they'd be cleaned even if the shell had been killed, and they wouldn't litter the usual WORKON_HOME.

The downside is that this would be a subtle behavior change, and the /tmp directory might have more lax read/write permissions than your usual WORKON_HOME (which could be a security liability)... maybe we could create a subfolder of /tmp and restrict permissions?

@AlexandreDecan
Copy link
Contributor Author

That could be a possibility. Is there any equivalent of /tmp on Windows?

If we're going to automatically remove temporary environments, we should perhaps add an option to make a temporary environment "persistent" (the workflow being "I would like to test something, I create a tmpenv, I realize I need more tests, I want to keep the environment for later"). Another possibility for that use case is to rely on pew cp, even if it has backwards.

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

No branches or pull requests

2 participants