Slightly better `xonsh` check hack, fix typing
parent
9e5c8ce6f6
commit
5b8a87d0f6
|
@ -197,7 +197,7 @@ class MultiActorPdb(pdbpp.Pdb):
|
||||||
self.cmdloop()
|
self.cmdloop()
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def shname(self) -> str:
|
def shname(self) -> str | None:
|
||||||
'''
|
'''
|
||||||
Attempt to return the login shell name with a special check for
|
Attempt to return the login shell name with a special check for
|
||||||
the infamous `xonsh` since it seems to have some issues much
|
the infamous `xonsh` since it seems to have some issues much
|
||||||
|
@ -206,11 +206,18 @@ class MultiActorPdb(pdbpp.Pdb):
|
||||||
'''
|
'''
|
||||||
# SUPER HACKY and only really works if `xonsh` is not used
|
# SUPER HACKY and only really works if `xonsh` is not used
|
||||||
# before spawning further sub-shells..
|
# before spawning further sub-shells..
|
||||||
xonsh_is_login_sh: bool = os.getenv('XONSH_LOGIN', default=False)
|
shpath = os.getenv('SHELL', None)
|
||||||
if xonsh_is_login_sh:
|
|
||||||
return 'xonsh'
|
|
||||||
|
|
||||||
return os.path.basename(os.getenv('SHELL'))
|
if shpath:
|
||||||
|
if (
|
||||||
|
os.getenv('XONSH_LOGIN', default=False)
|
||||||
|
or 'xonsh' in shpath
|
||||||
|
):
|
||||||
|
return 'xonsh'
|
||||||
|
|
||||||
|
return os.path.basename(shpath)
|
||||||
|
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
@acm
|
@acm
|
||||||
|
|
Loading…
Reference in New Issue