virtualenvwrapper-win icon indicating copy to clipboard operation
virtualenvwrapper-win copied to clipboard

deactivate.bat doesn't cd back to %_LAST_DIR%

Open thepacketgeek opened this issue 10 years ago • 4 comments

In cdvirtualenv.bat, there is logic setting %_LAST_DIR% to the current directory, but nothing in deactivate.bat to change back to the %_LAST_DIR% before activating.

Before I fork/MR, is this expected behavior for some reason?

Thanks!

thepacketgeek avatar Feb 25 '15 19:02 thepacketgeek

I'm ok with both versions. Not cd (as it is now) and cd to first dir as you propose. Maybe do it on option or some env variable (like VENV_CD_BACK or something). Anyway. Looking forward for PR if you'll think about something.

utek avatar Feb 25 '15 21:02 utek

Great, I like your idea of having options as well. I'll work on this soon.

thepacketgeek avatar Mar 02 '15 16:03 thepacketgeek

I'm a big -1 on this. It's surprising and annoying to be pulled from your flow, e.g.:

\> workon py27
(py27) \> cd my\source
(py27) \my\source> :: fix something / test something
(py27) \my\source> workon py35
(py35) \my\source> :: fix something / test something
(py35) \my\source> deactivate
\my\source> :: maybe run tox or work on docs in global sphinx..

if I got tossed back to \ after deactivate I would find it surprising and unwelcome. cd-.bat mostly does what is asked here - except for the %_LAST_DIR% being continually clobbered. We could fix this by either appending to %_LAST_DIR% instead of overwriting, or by using pushd and make cd- a synonym for popd.

thebjorn avatar Aug 11 '17 14:08 thebjorn

deactivate.bat is not our file (although this might be changing -- see my comment on PR #73), making this difficult. This issue should stay open until our version of deactivate comes so we don't forget.

thebjorn avatar Dec 29 '17 02:12 thebjorn