#591: Add path_from_history rule

This commit is contained in:
Vladimir Iakovlev
2017-03-13 19:05:34 +01:00
parent 350be285b8
commit 2379573cf2
4 changed files with 100 additions and 1 deletions
+3 -1
View File
@@ -268,7 +268,9 @@ def get_valid_history_without_current(command):
from thefuck.shells import shell
history = shell.get_history()
tf_alias = get_alias()
executables = set(get_all_executables())
executables = set(get_all_executables())\
.union(shell.get_builtin_commands())
return [line for line in _not_corrected(history, tf_alias)
if not line.startswith(tf_alias) and not line == command.script
and line.split(' ')[0] in executables]