From c909317ca0bd733577a56707caa3e8ff2dacb650 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Wed, 18 Apr 2018 16:22:01 +0200 Subject: [PATCH] Make TerminalCommands alias nonexistent commands only --- lib/tfw/components/terminal_commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tfw/components/terminal_commands.py b/lib/tfw/components/terminal_commands.py index 7663868..e95e3bc 100644 --- a/lib/tfw/components/terminal_commands.py +++ b/lib/tfw/components/terminal_commands.py @@ -22,7 +22,7 @@ class TerminalCommands(ABC): def _setup_bashrc_aliases(self, bashrc): with open(bashrc, 'a') as ofile: - alias_template = 'alias {0}="{0} > /dev/null 2>&1"\n' + alias_template = 'type {0} &> /dev/null || alias {0}="{0} &> /dev/null"\n' for command in self.command_implemetations.keys(): ofile.write(alias_template.format(command))