mirror of
https://github.com/nvbn/thefuck.git
synced 2025-02-21 20:38:54 +00:00
Don't run a shell just to run another shell
This commit is contained in:
parent
3bd2c8d4c8
commit
514bb7df81
@ -86,8 +86,7 @@ class Bash(Generic):
|
|||||||
|
|
||||||
@memoize
|
@memoize
|
||||||
def get_aliases(self):
|
def get_aliases(self):
|
||||||
proc = Popen('bash -ic alias', stdout=PIPE, stderr=DEVNULL,
|
proc = Popen(['bash', '-ic', 'alias'], stdout=PIPE, stderr=DEVNULL)
|
||||||
shell=True)
|
|
||||||
return dict(
|
return dict(
|
||||||
self._parse_alias(alias)
|
self._parse_alias(alias)
|
||||||
for alias in proc.stdout.read().decode('utf-8').split('\n')
|
for alias in proc.stdout.read().decode('utf-8').split('\n')
|
||||||
@ -131,8 +130,7 @@ class Fish(Generic):
|
|||||||
@memoize
|
@memoize
|
||||||
def get_aliases(self):
|
def get_aliases(self):
|
||||||
overridden = self._get_overridden_aliases()
|
overridden = self._get_overridden_aliases()
|
||||||
proc = Popen('fish -ic functions', stdout=PIPE, stderr=DEVNULL,
|
proc = Popen(['fish', '-ic', 'functions'], stdout=PIPE, stderr=DEVNULL)
|
||||||
shell=True)
|
|
||||||
functions = proc.stdout.read().decode('utf-8').strip().split('\n')
|
functions = proc.stdout.read().decode('utf-8').strip().split('\n')
|
||||||
return {func: func for func in functions if func not in overridden}
|
return {func: func for func in functions if func not in overridden}
|
||||||
|
|
||||||
@ -172,8 +170,7 @@ class Zsh(Generic):
|
|||||||
|
|
||||||
@memoize
|
@memoize
|
||||||
def get_aliases(self):
|
def get_aliases(self):
|
||||||
proc = Popen('zsh -ic alias', stdout=PIPE, stderr=DEVNULL,
|
proc = Popen(['zsh', '-ic', 'alias'], stdout=PIPE, stderr=DEVNULL)
|
||||||
shell=True)
|
|
||||||
return dict(
|
return dict(
|
||||||
self._parse_alias(alias)
|
self._parse_alias(alias)
|
||||||
for alias in proc.stdout.read().decode('utf-8').split('\n')
|
for alias in proc.stdout.read().decode('utf-8').split('\n')
|
||||||
@ -205,8 +202,7 @@ class Tcsh(Generic):
|
|||||||
|
|
||||||
@memoize
|
@memoize
|
||||||
def get_aliases(self):
|
def get_aliases(self):
|
||||||
proc = Popen('tcsh -ic alias', stdout=PIPE, stderr=DEVNULL,
|
proc = Popen(['tcsh', '-ic', 'alias'], stdout=PIPE, stderr=DEVNULL)
|
||||||
shell=True)
|
|
||||||
return dict(
|
return dict(
|
||||||
self._parse_alias(alias)
|
self._parse_alias(alias)
|
||||||
for alias in proc.stdout.read().decode('utf-8').split('\n')
|
for alias in proc.stdout.read().decode('utf-8').split('\n')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user