Re:Be Careful Using Tmux and Environment Variables
by trollied on Saturday March 04, 2023 @03:11PM
(#35024046)
Surely you'd run a script as part of your task to make sure it was all set correctly? This just seems like a bad setup.
Re:Be Careful Using Tmux and Environment Variables
by bb88 on Saturday March 04, 2023 @05:14PM
(#35025004)
If you thought you were reloading the dev environment database, and found out you just reloaded your production database, you would be surprised too. And you would probably wonder why after setting the dev variables, the tmux shell didn't have them.
It's one of those rare gotchas that will bite someone in the ass. And it will hurt. And when it does, you'll swear like a mother f'er.
Ultimately we decided to use a named tmux socket to ensure the environment variables were picked up correctly when set via the make task but you can also use `set-environment` as well if the ergonomics hit of having to use the named socket each time is too much. It's nice that tmux provides a few work arounds but I thought the original behavior was not intuitive.