I'm using fish and looks pipenv works fine without shell command:
❰/private/tmp/asd❱✔≻ pipenv shell
Spawning virtualenv shell (/usr/local/bin/fish).
Unsupported use of '||'. In fish, please use 'COMMAND; or COMMAND'.
/private/tmp/asd/.venv/bin/activate (line 23): if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then
^
from sourcing file /private/tmp/asd/.venv/bin/activate
called on line 194 of file /usr/local/Cellar/fish/2.4.0/share/fish/config.fish
in function '.'
called on standard input
source: Error while reading file '/private/tmp/asd/.venv/bin/activate'
Seems it is trying to active the virtualenv with bin/active
, but virtualenv also support fish via bin/active.fish
, i think we can source it while detected current shell is fish.
And also, i think pipenv dose not support csh / cmd.exe now...
FWIW, this is what inve is all about (#10), and is the reason that I was suggesting it.
adding fish support should be easy enough!
released!
i don't have the ability to test powershell at the moment
csh supported, bash supported, fish supported
Powershell support would be much involved because there are no environment variables to test. Testing sys.platform == 'win32'
is not enough since Powershell and the Command Prompt use different activate scripts. And aside from that Pexpect doesn’t even support spawn
on Windows, so it won’t work anyway…
We may have to not support powershell then.
One option, although I'm not sure how I feel about it, would be to first determine the system, and if it's win32
do feature detection to determine whether the shell was Command Prompt or Powershell.
@uranusjr It is possible to detect the difference between Powershell and Command Prompt, for example using the psutil module:
import psutil
import sys
if sys.platform() == 'win32':
me = psutil.Process()
parent = psutil.Process(me.ppid())
# Prints 'powershell.exe' or 'cmd.exe'
print(parent.name())
However as you mentioned, pexpect.spawn
is not supported on Windows, and there are no plans for it ever to be.
going to drop windows support for now.
Most helpful comment
going to drop windows support for now.