From 02cbd637c818553e5e5a32fe67e5b151e4f798e9 Mon Sep 17 00:00:00 2001 From: v4rgas <66626747+v4rgas@users.noreply.github.com> Date: Thu, 15 May 2025 17:08:53 -0400 Subject: [PATCH] 201e0e0b-2c7e-462f-8ae9-ee9d820b3619 --- thefuck_3/tests/shells/test_fish.py | 3 +-- thefuck_3/thefuck/shells/fish.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/thefuck_3/tests/shells/test_fish.py b/thefuck_3/tests/shells/test_fish.py index 047a802..6d8a66f 100644 --- a/thefuck_3/tests/shells/test_fish.py +++ b/thefuck_3/tests/shells/test_fish.py @@ -114,6 +114,5 @@ def test_how_to_configure_when_config_not_found(self, shell, assert not shell.how_to_configure().can_configure_automatically def test_info(self, shell, Popen): - Popen.return_value.stdout.read.side_effect = [b'fish, version 3.5.9\n'] + Popen.return_value.stdout.read.side_effect = [b'3.5.9'] assert shell.info() == 'Fish Shell 3.5.9' - assert Popen.call_args[0][0] == ['fish', '--version'] diff --git a/thefuck_3/thefuck/shells/fish.py b/thefuck_3/thefuck/shells/fish.py index 8b4ca57..1435f90 100644 --- a/thefuck_3/thefuck/shells/fish.py +++ b/thefuck_3/thefuck/shells/fish.py @@ -105,9 +105,9 @@ def how_to_configure(self): def info(self): """Returns the name and version of the current shell""" - proc = Popen(['fish', '--version'], + proc = Popen(['fish', '-c', 'echo $FISH_VERSION'], stdout=PIPE, stderr=DEVNULL) - version = proc.stdout.read().decode('utf-8').split()[-1] + version = proc.stdout.read().decode('utf-8').strip() return u'Fish Shell {}'.format(version) def put_to_history(self, command):