diff --git a/tests/shells/test_fish.py b/tests/shells/test_fish.py index 836a648..dacc018 100644 --- a/tests/shells/test_fish.py +++ b/tests/shells/test_fish.py @@ -71,6 +71,7 @@ class TestFish(object): assert 'function fuck' in shell.app_alias('fuck') assert 'function FUCK' in shell.app_alias('FUCK') assert 'thefuck' in shell.app_alias('fuck') + assert 'TF_SHELL=fish' in shell.app_alias('fuck') assert 'TF_ALIAS=fuck PYTHONIOENCODING' in shell.app_alias('fuck') assert 'PYTHONIOENCODING=utf-8 thefuck' in shell.app_alias('fuck') diff --git a/tests/shells/test_tcsh.py b/tests/shells/test_tcsh.py index 7bc8ae3..014c3c9 100644 --- a/tests/shells/test_tcsh.py +++ b/tests/shells/test_tcsh.py @@ -44,6 +44,7 @@ class TestTcsh(object): 'll': 'ls -alF'} def test_app_alias(self, shell): + assert 'setenv TF_SHELL tcsh' in shell.app_alias('fuck') assert 'alias fuck' in shell.app_alias('fuck') assert 'alias FUCK' in shell.app_alias('FUCK') assert 'thefuck' in shell.app_alias('fuck') diff --git a/thefuck/shells/fish.py b/thefuck/shells/fish.py index 56ad214..0b635db 100644 --- a/thefuck/shells/fish.py +++ b/thefuck/shells/fish.py @@ -35,7 +35,7 @@ class Fish(Generic): # It is VERY important to have the variables declared WITHIN the alias return ('function {0} -d "Correct your previous console command"\n' ' set -l fucked_up_command $history[1]\n' - ' env TF_ALIAS={0} PYTHONIOENCODING=utf-8' + ' env TF_SHELL=fish TF_ALIAS={0} PYTHONIOENCODING=utf-8' ' thefuck $fucked_up_command | read -l unfucked_command\n' ' if [ "$unfucked_command" != "" ]\n' ' eval $unfucked_command\n{1}' diff --git a/thefuck/shells/tcsh.py b/thefuck/shells/tcsh.py index d8470eb..0911f04 100644 --- a/thefuck/shells/tcsh.py +++ b/thefuck/shells/tcsh.py @@ -7,7 +7,7 @@ from .generic import Generic class Tcsh(Generic): def app_alias(self, alias_name): - return ("alias {0} 'setenv TF_ALIAS {0} && " + return ("alias {0} 'setenv TF_SHELL tcsh && setenv TF_ALIAS {0} && " "set fucked_cmd=`history -h 2 | head -n 1` && " "eval `thefuck ${{fucked_cmd}}`'").format(alias_name)