mirror of
https://github.com/nvbn/thefuck.git
synced 2025-09-16 18:22:34 +01:00
Make thefuck-alias
depends on current shell
This commit is contained in:
@@ -120,7 +120,7 @@ def run_rule(rule, command, history, settings):
|
||||
|
||||
|
||||
def alias():
|
||||
print("\nalias fuck='eval $(thefuck $(fc -ln -1))'\n")
|
||||
print(shells.app_alias())
|
||||
|
||||
|
||||
def main():
|
||||
|
@@ -31,6 +31,9 @@ class Generic(object):
|
||||
"""Prepares command for running in shell."""
|
||||
return command_script
|
||||
|
||||
def app_alias(self):
|
||||
return "\nalias fuck='eval $(thefuck $(fc -ln -1))'\n"
|
||||
|
||||
|
||||
class Bash(Generic):
|
||||
def _parse_alias(self, alias):
|
||||
@@ -78,3 +81,7 @@ def from_shell(command):
|
||||
|
||||
def to_shell(command):
|
||||
return _get_shell().to_shell(command)
|
||||
|
||||
|
||||
def app_alias():
|
||||
return _get_shell().app_alias()
|
||||
|
Reference in New Issue
Block a user