Code Monkey home page Code Monkey logo

Comments (5)

dopry avatar dopry commented on June 19, 2024

I've dug into this a bit more... I'm using pyenv which has a shim that wraps the call to python in a .bat script which uses cmd.exe.

For nt shells it may be better to not stop at the first shell you see, but to use the last shell in the stack, at least if you're looking for the interactive shell, maybe there should be a detect_interactive_shell(), the uses cases I'm looking at are poetry env shell and pipenv shell...

>>> import psutil
>>> import os
>>> proc = psutil.Process()
>>> parent_1 = psutil.Process(proc.ppid())
>>> parent_1
psutil.Process(pid=25652, name='cmd.exe', status='running', started='08:43:04')
>>> parent_2 = psutil.Process(parent_1.ppid())
>>> parent_2
psutil.Process(pid=3680, name='powershell.exe', status='running', started='07:37:02')
>>> parent_3 = psutil.Process(parent_2.ppid())
>>> parent_3
psutil.Process(pid=3664, name='WindowsTerminal.exe', status='running', started='07:36:59')
>>> parent_4 =  psutil.Process(parent_3.ppid())
>>> parent_4
psutil.Process(pid=23448, name='explorer.exe', status='running', started='2022-11-11 08:00:07')

from shellingham.

uranusjr avatar uranusjr commented on June 19, 2024

I would categorise this as a bug in pyenv-win. They should not use Batch files for shims. Shims should be exe.

from shellingham.

dopry avatar dopry commented on June 19, 2024

@uranusjr while I agree and find pyenv-win's shims and rehash are annoying, I'm not sure that it is possible with an exe. Do you know of an exe shim example you can point me to, maybe I can contribute some time to working on that.

from shellingham.

uranusjr avatar uranusjr commented on June 19, 2024

From pyenv-win’s issue tracker pyenv-win/pyenv-win#352

Scoop also has a shim implementation that I personally like a lot, although it being in C# is probably a hurdle for a project adding a compilation step (I don’t think pyenv-win currently has any such dependencies).

from shellingham.

dopry avatar dopry commented on June 19, 2024

@uranusjr thanks!!

from shellingham.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.