From 17b9104939b9d6899562b45975dc6afd356b0d6a Mon Sep 17 00:00:00 2001 From: Tevin Zhang Date: Mon, 18 May 2015 18:44:55 +0800 Subject: [PATCH] better way to get shell --- thefuck/shells.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/thefuck/shells.py b/thefuck/shells.py index 5443c652..e372eb3e 100644 --- a/thefuck/shells.py +++ b/thefuck/shells.py @@ -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):