mirror of
https://github.com/nvbn/thefuck.git
synced 2025-02-20 20:09:07 +00:00
better way to get shell
This commit is contained in:
parent
02d9613618
commit
17b9104939
@ -153,16 +153,16 @@ shells = defaultdict(lambda: Generic(), {
|
||||
'bash': Bash(),
|
||||
'fish': Fish(),
|
||||
'zsh': Zsh(),
|
||||
'-csh': Tcsh(),
|
||||
'csh': Tcsh(),
|
||||
'tcsh': Tcsh()})
|
||||
|
||||
|
||||
def _get_shell():
|
||||
try:
|
||||
shell = Process(os.getpid()).parent().cmdline()[0]
|
||||
shell = Process(os.getpid()).parent().name()
|
||||
except TypeError:
|
||||
shell = Process(os.getpid()).parent.cmdline[0]
|
||||
return shells[os.path.basename(shell)]
|
||||
shell = Process(os.getpid()).parent.name()
|
||||
return shells[shell]
|
||||
|
||||
|
||||
def from_shell(command):
|
||||
|
Loading…
x
Reference in New Issue
Block a user