After I have set up a development shell (e.g., by starting a PostgreSQL cluster with a particular configuration, exporting several environment variables, "installed" a bunch of applications via nix-shell
), I want to start tmux where everything from the calling shell is available.
By default, tmux ignores my environment variables, and all the solutions I've found spell out how one has to re-declare each variable again, one-by-one. (Could be wrong though as I'm also having trouble deciphering the relevant section of the tmux man page.)
- Why do I have to re-set env vars in tmux when I re-attach?
- https://stackoverflow.com/questions/20701757/tmux-setting-environment-variables-for-sessions
I like the static, declarative approach in production, but sometimes I just want to quickly hack away at stuff.