How to fix the problem of IntelliJ not able to see terminal commands

I just run into a problem after installing Intellij from the Pop!_OS shop, the IDE was working fine but when I opened a terminal it would be able to see all the shells.

This happens because the installation was via `IntelliJ IDEA via flatpak`

To fix this issue add this to the terminal

/usr/bin/env -- flatpak-spawn --host zsh

then it works