Closed pmeier closed 1 year ago
It would be best if you could do some digging since it’s close to impossible to replicate your exact environment. There is no way I can help with just this information.
It would be best if you could do some digging since it’s close to impossible to replicate your exact environment.
Will do and get back to you.
There is no way I can help with just this information.
I couldn't find any information about what I should provide. Happy to oblige.
It seems the detection fails, because it doesn't find any processes other than the current one:
❯ cat -p git/ora/foo.py
from shellingham import detect_shell
detect_shell()
❯ python git/ora/foo.py
detect_shell(): impl=<module 'shellingham.posix' from '/home/philip/.conda/envs/ora-dev/lib/python3.11/site-packages/shellingham/posix/__init__.py'>
get_shell(): pid='7531', mapping={'7531': Process(args=('python', 'git/ora/foo.py'), pid='7531', ppid='34819')}
get_shell(): proc_args=('python', 'git/ora/foo.py')
Traceback (most recent call last):
File "/home/philip/git/ora/foo.py", line 3, in <module>
detect_shell()
File "/home/philip/.conda/envs/ora-dev/lib/python3.11/site-packages/shellingham/__init__.py", line 25, in detect_shell
raise ShellDetectionFailure()
shellingham._core.ShellDetectionFailure
Interesting. Can you describe your environment a bit? What operating system are you on, is there emulation involved (32-64 bit binaries, for example), a user that may have permission restrictions, or similar things? Try to dig into doing the process detection part manually as well, does the detection method (proc os ps?) really return only the current process, or is there a problem with parsing?
Can you describe your environment a bit? What operating system are you on, is there emulation involved (32-64 bit binaries, for example)
No emulation. I'm directly on a x86_64 Arch Linux box.
a user that may have permission restrictions
Default user with sudo
permissions.
the detection method (proc os ps?)
It is looking at /proc
. I'm hitting shellingham.posix.proc.get_process_mapping
.
Something is off here. _get_stat
returns ppid, tty
but get_process_mapping
unpacks it as
Yep, that seems to be it. Will send a PR.
I see this is already fixed on master
with 13aa99d5bedb2548aede6a57353a3bb644f8045e and ultimately completely refactored with #75 that no longer uses the TTY at all. Can confirm that with 1.5.1
installed, my shell is correctly detected.
@uranusjr I see that 1.5.1
is yanked on PyPI. Any chance we can get a new release soon that includes the patches above?
The version was yanked due to an incompatibility. I attempted to address it and released 1.5.2.
Can confirm that this particular issue is fixed in 1.5.2
. Thanks!
Not sure what is going on here: