File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ pairing with smart people at Hashrocket.
1010
1111For a steady stream of TILs, [ sign up for my newsletter] ( https://crafty-builder-6996.ck.page/e169c61186 ) .
1212
13- _ 1177 TILs and counting..._
13+ _ 1178 TILs and counting..._
1414
1515---
1616
@@ -1064,6 +1064,7 @@ _1177 TILs and counting..._
10641064- [ Remove The Delay On The Escape Key] ( tmux/remove-the-delay-on-the-escape-key.md )
10651065- [ Rename The Current Session] ( tmux/rename-the-current-session.md )
10661066- [ Reset An Option Back To Its Default Value] ( tmux/reset-an-option-back-to-its-default-value.md )
1067+ - [ Set Environment Variables When Creating Session] ( tmux/set-environment-variables-when-creating-session.md )
10671068- [ Set Session Specific Environment Variables] ( tmux/set-session-specific-environment-variables.md )
10681069- [ Show The Current Value For An Option] ( tmux/show-the-current-value-for-an-option.md )
10691070- [ Swap Split Panes] ( tmux/swap-split-panes.md )
Original file line number Diff line number Diff line change 1+ # Set Environment Variables When Creating Session
2+
3+ In [ Set Session-Specific Environment
4+ Variables] ( set-session-specific-environment-variables.md ) , I showed how env
5+ vars that are scoped to a tmux session can be set in an existing session.
6+
7+ It is also possible to set any number of environment variables when creating a
8+ session. This is particularly handy if you are scripting the setup of various
9+ tmux environments.
10+
11+ A base command to start a tmux session might look like this:
12+
13+ ``` bash
14+ $ tmux new -s my-project
15+ ```
16+
17+ To set environment variables on that session, use one or more ` -e ` flags
18+ followed by the name and value.
19+
20+ ``` bash
21+ $ tmux new -s my-project -e EDITOR=code -e PG_VERSION=13.4
22+ ```
23+
24+ See ` man tmux ` for more details.
You can’t perform that action at this time.
0 commit comments