# Fish error every time I activate default environment

**URL:** <https://discourse.flox.dev/t/fish-error-every-time-i-activate-default-environment/943>\
**Category:** Bug Reports\
**Created:** [August 24, 2024, 6:32pm UTC](https://discourse.flox.dev/t/fish-error-every-time-i-activate-default-environment/943 "2024-08-24T18:32:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lofidevops](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/lofidevops/32/682_2.png) [@lofidevops](https://discourse.flox.dev/u/lofidevops)\
**Post date:** [August 24, 2024, 6:32pm UTC](https://discourse.flox.dev/t/fish-error-every-time-i-activate-default-environment/943/1 "2024-08-24T18:32:44Z")

</div>

I installed the flox deb on Ubuntu 22.04. My default shell is fish (3.3.1).

Steps to reproduce:

- cd $HOME
- flox init
- flox activate

What should happen:

```auto
✅ You are now using the environment 'default'.

```

What happens instead:

```auto
✅ You are now using the environment 'default'.
To stop using this environment, type 'exit'

~/.flox/run/x86_64-linux.default/activate.d/fish (line 17): 'return' outside of function definition
  return 1
  ^
from sourcing file ~/.flox/run/x86_64-linux.default/activate.d/fish
source: Error while reading file “/home/user/.flox/run/x86_64-linux.default/activate.d/fish”

```

This happens every time I try to activate the environment.

---

<div class="post-metadata">

**Author:** ![ghudgins](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/ghudgins/32/588_2.png) [@ghudgins](https://discourse.flox.dev/u/ghudgins)\
**Post date:** [August 28, 2024, 4:47pm UTC](https://discourse.flox.dev/t/fish-error-every-time-i-activate-default-environment/943/2 "2024-08-28T16:47:27Z")

</div>

any chance you can upgrade to fish 3.7.1?

---

<div class="post-metadata">

**Author:** ![lofidevops](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/lofidevops/32/682_2.png) [@lofidevops](https://discourse.flox.dev/u/lofidevops)\
**Post date:** [August 28, 2024, 6:32pm UTC](https://discourse.flox.dev/t/fish-error-every-time-i-activate-default-environment/943/3 "2024-08-28T18:32:48Z")

</div>

[Apparently I can!](https://launchpad.net/~fish-shell/+archive/ubuntu/release-3) I will give that a go and report back.

---

<div class="post-metadata">

**Author:** ![lofidevops](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/lofidevops/32/682_2.png) [@lofidevops](https://discourse.flox.dev/u/lofidevops)\
**Post date:** [September 4, 2024, 7:27pm UTC](https://discourse.flox.dev/t/fish-error-every-time-i-activate-default-environment/943/4 "2024-09-04T19:27:42Z")

</div>

Confirmed that with fish 3.7.1 as my default system shell, I can now `flox init; flox activate` without error!

---

<div class="post-metadata">

**Author:** ![ghudgins](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/ghudgins/32/588_2.png) [@ghudgins](https://discourse.flox.dev/u/ghudgins)\
**Post date:** [September 4, 2024, 9:13pm UTC](https://discourse.flox.dev/t/fish-error-every-time-i-activate-default-environment/943/5 "2024-09-04T21:13:46Z")

</div>

So great to hear!

We’re working on fixing the support for older versions as well! [Flox failing when using fish shell · Issue #2016 · flox/flox · GitHub](https://github.com/flox/flox/issues/2016)
