diff --git a/thefuck/logs.py b/thefuck/logs.py index 15f232a4..e783c5f8 100644 --- a/thefuck/logs.py +++ b/thefuck/logs.py @@ -83,13 +83,14 @@ def how_to_configure_alias(configuration_details): print("Seems like {bold}fuck{reset} alias isn't configured!".format( bold=color(colorama.Style.BRIGHT), reset=color(colorama.Style.RESET_ALL))) + if configuration_details: - content, path = configuration_details print( "Please put {bold}{content}{reset} in your " - "{bold}{path}{reset}.".format( + "{bold}{path}{reset} and apply " + "changes with {bold}{reload}{reset} or restart your shell.".format( bold=color(colorama.Style.BRIGHT), reset=color(colorama.Style.RESET_ALL), - path=path, - content=content)) + **configuration_details)) + print('More details - https://github.com/nvbn/thefuck#manual-installation') diff --git a/thefuck/shells/bash.py b/thefuck/shells/bash.py index d6f4cdff..c5ff5359 100644 --- a/thefuck/shells/bash.py +++ b/thefuck/shells/bash.py @@ -44,4 +44,9 @@ class Bash(Generic): config = '~/.bashrc' else: config = 'bash config' - return 'eval $(thefuck --alias)', config + + return { + 'content': 'eval $(thefuck --alias)', + 'path': config, + 'reload': u'source {}'.format(config), + } diff --git a/thefuck/shells/fish.py b/thefuck/shells/fish.py index 0703afc0..e20ce29e 100644 --- a/thefuck/shells/fish.py +++ b/thefuck/shells/fish.py @@ -67,8 +67,11 @@ class Fish(Generic): return u'; and '.join(commands) def how_to_configure(self): - return (r"eval (thefuck --alias | tr '\n' ';')", - '~/.config/fish/config.fish') + return { + 'content': r"eval (thefuck --alias | tr '\n' ';')", + 'path': '~/.config/fish/config.fish', + 'reload': 'fish', + } def put_to_history(self, command): try: diff --git a/thefuck/shells/powershell.py b/thefuck/shells/powershell.py index 160a05c4..8e5d994d 100644 --- a/thefuck/shells/powershell.py +++ b/thefuck/shells/powershell.py @@ -15,4 +15,8 @@ class Powershell(Generic): return u' -and '.join('({0})'.format(c) for c in commands) def how_to_configure(self): - return 'iex "thefuck --alias"', '$profile' + return { + 'content': 'iex "thefuck --alias"', + 'path': '$profile', + 'reload': '& $profile', + } diff --git a/thefuck/shells/tcsh.py b/thefuck/shells/tcsh.py index 6c355caa..057dc560 100644 --- a/thefuck/shells/tcsh.py +++ b/thefuck/shells/tcsh.py @@ -31,4 +31,8 @@ class Tcsh(Generic): return u'#+{}\n{}\n'.format(int(time()), command_script) def how_to_configure(self): - return 'eval `thefuck --alias`', '~/.tcshrc' + return { + 'content': 'eval `thefuck --alias`', + 'path': '~/.tcshrc', + 'reload': 'tcsh', + } diff --git a/thefuck/shells/zsh.py b/thefuck/shells/zsh.py index 3f8bd80c..24551462 100644 --- a/thefuck/shells/zsh.py +++ b/thefuck/shells/zsh.py @@ -45,4 +45,8 @@ class Zsh(Generic): return '' def how_to_configure(self): - return 'eval $(thefuck --alias)', '~/.zshrc' + return { + 'content': 'eval $(thefuck --alias)', + 'path': '~/.zshrc', + 'reload': 'source ~/.zshrc', + }