refact(shells): add support to Fish functions

Signed-off-by: Pablo Santiago Blum de Aguiar <scorphus@gmail.com>
This commit is contained in:
Pablo Santiago Blum de Aguiar
2015-05-21 23:55:49 -03:00
parent 2bebfabf8d
commit 551e35e3b6
2 changed files with 18 additions and 1 deletions
+9
View File
@@ -97,6 +97,15 @@ class Fish(Generic):
" end\n"
"end")
def get_aliases(self):
if not self._aliases:
proc = Popen('fish -ic functions', stdout=PIPE, stderr=DEVNULL,
shell=True)
functions = proc.stdout.read().decode('utf-8').strip().split('\n')
self._aliases = dict((function, function) for function in functions)
return self._aliases
def _get_history_file_name(self):
return os.path.expanduser('~/.config/fish/fish_history')