← Back to context

Comment by rovr138

1 day ago

./script.sh

and script.sh just starts with #/bin/bash

I'm simple

This wouldn't work if the script is meant to be sourced (to set environment variables) isn't it?

  • No, it doesn't.

    The way I actually have things setup, in case it helps. I don't change my default shell. I actually default to pretty much working within tmux. So, I kept my default shell to what the OS brings, then in my tmux config, I have,

        # set shell
        set -g default-shell /opt/homebrew/bin/fish
    

    This means, that when I start my terminal, it drops me to zsh (macOS default). Then when I run tmux, it opens fish. The nice thing is that I inherit the environment of zsh.

    I have my .zshrc and my .bashrc sourcing a .shellrc file which contains most of my env stuff. This keeps random utilities that write to .bashrc and zshrc working within fish too.