Using Rider with zsh doesn't work when Unity opens Rider

I am running into an issue where when Unity opens Rider which has terminal set within IDE to /usr/bin/zsh), it won’t use zsh for some reason, and of course all of my applications and env variables are setup using scripts and such via zsh.

If I open Rider on it’s own zsh is picked up and works just fine. It has all my env variables, installed applications and proper $PATH, but with Unity I just keep getting:

Cannot open Local Terminal
Failed to start [/usr/bin/zsh, -i] in /home/mosthated/path/to/project

For Rider to work in general with zsh I had to go into /home/mosthated/.local/share/JetBrains/Toolbox/apps/Rider/ch-0/192.5895.1069/plugins/terminal/.zshrc and change the last function to the following for it to work:

function override_jb_variables {
  for VARIABLE in $(env)
  do
    NAME=${VARIABLE%%=*}
    if [[ $NAME = '_INTELLIJ_FORCE_SET_'* ]]
    then
      NEW_NAME=${NAME:20}
      if [ -n "$NEW_NAME" ] && [ "$NEW_NAME" != "PATH" ]
      then
        VALUE=${VARIABLE#*=}
        export "$NEW_NAME"="$VALUE"
      fi
    fi
  done
}

Does Unity have it’s own settings/config somewhere that is overwriting what may be in the above path that I need to change somewhere for it to work? Unity/Rider is even thinking Git isn’t installed when it opens, so it is going to end up being quite inconvenient.

Thanks,
-MH

Looks like I have it worked out. I had to initially start Unity hub as sudo and then it finally ended up working.

EDIT

For some reason, only after logging out and back in starting Unity Hub as sudo began opening Unity itself as well as Rider as as root, which gave a warning message, then also tried to load a new Rider profile for the root user.

So it looks like the actual solution is simply starting the Unity Hub application from the terminal.
I created a zsh alias for this :

alias unity='/home/mosthated/_dev/applications/UnityHubSetup.AppImage'