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

Does not detect shell when called from within Far Manager #9

Closed
tivnet opened this issue Jul 25, 2018 · 9 comments · Fixed by pypa/pipenv#2651
Closed

Does not detect shell when called from within Far Manager #9

tivnet opened this issue Jul 25, 2018 · 9 comments · Fixed by pypa/pipenv#2651

Comments

@tivnet
Copy link

tivnet commented Jul 25, 2018

https://www.farmanager.com/download.php?l=en

C:\tmp>pipenv shell
Traceback (most recent call last):
  File "c:\python36\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
...
...
File "c:\python36\lib\site-packages\pipenv\shells.py", line 29, in detect_info
raise ShellDetectionFailure
pipenv.vendor.shellingham.ShellDetectionFailure

The same under regular command prompt works fine:

C:\tmp>pipenv shell
Launching subshell in virtual environment…
Microsoft Windows [Version 10.0.16299.461]
(c) 2017 Microsoft Corporation. All rights reserved.

@uranusjr FYI

@uranusjr
Copy link
Member

I learn a new thing today! To work around this you can set PIPENV_SHELL to avoid shell detection (in case anyone reading this issue doesn’t know). Maybe I should add an error message here.

@tivnet
Copy link
Author

tivnet commented Jul 25, 2018

@uranusjr Just curious, can you check the COMSPEC env instead of using the nt module?

C:\tmp>echo %COMSPEC%
C:\WINDOWS\system32\cmd.exe

@techalchemy
Copy link
Member

Comspec always has that value

@tivnet
Copy link
Author

tivnet commented Jul 25, 2018

Comspec always has that value

and so, it can be used to run the shell, can't it?

@uranusjr
Copy link
Member

COMSPEC is always cmd.exe even if you are running another shell, e.g. Powershell. It would be very surprising to users if a cmd.exe is launched when the outer shell is not cmd.exe.

@tivnet
Copy link
Author

tivnet commented Jul 25, 2018

OK, then you can still use it if you failed to get the real shell from the nt module, probably?

@techalchemy
Copy link
Member

@tivnet if you think you have a solution we would be interested in reviewing a PR or an example of what you mean, we've spent a considerable amount of effort looking at this problem and didn't come to a consistent and acceptable answer

@uranusjr
Copy link
Member

PR is up. (This is actually fixed in Pipenv; Shellingham is only interested in shell detection, it’s up to the callee to handle the failure and choose a reasonable fallback.)

@uranusjr uranusjr reopened this Jul 26, 2018
@uranusjr
Copy link
Member

Sorry, shouldn’t close this—I should look into Far Manager and see if Shellingham can detect it.

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

Successfully merging a pull request may close this issue.

3 participants