1
0
mirror of https://github.com/nvbn/thefuck.git synced 2024-10-06 02:41:10 +01:00

Merge pull request #208 from tevino/get-shell-fix

better way to get shell
This commit is contained in:
Vladimir Iakovlev 2015-05-20 16:39:08 +03:00
commit c42898dde3

View File

@ -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):