mirror of
https://github.com/nvbn/thefuck.git
synced 2025-02-21 12:28:41 +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(),
|
'bash': Bash(),
|
||||||
'fish': Fish(),
|
'fish': Fish(),
|
||||||
'zsh': Zsh(),
|
'zsh': Zsh(),
|
||||||
'-csh': Tcsh(),
|
'csh': Tcsh(),
|
||||||
'tcsh': Tcsh()})
|
'tcsh': Tcsh()})
|
||||||
|
|
||||||
|
|
||||||
def _get_shell():
|
def _get_shell():
|
||||||
try:
|
try:
|
||||||
shell = Process(os.getpid()).parent().cmdline()[0]
|
shell = Process(os.getpid()).parent().name()
|
||||||
except TypeError:
|
except TypeError:
|
||||||
shell = Process(os.getpid()).parent.cmdline[0]
|
shell = Process(os.getpid()).parent.name()
|
||||||
return shells[os.path.basename(shell)]
|
return shells[shell]
|
||||||
|
|
||||||
|
|
||||||
def from_shell(command):
|
def from_shell(command):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user