tmuxp icon indicating copy to clipboard operation
tmuxp copied to clipboard

config: Allow passing environment into environment variables

Open tony opened this issue 4 years ago • 1 comments

related: #669

assuming

session_name: django
environment:
  SERVER_PORT: "8012"
- window_name: test ${SERVER_PORT}
  layout: main-horizontal
  focus: true
  panes:
  - focus: True
  - blank

Allow window_name to receive SERVER_PORT without having to do env SERVER_PORT=8012 tmuxp load ./file.yaml

Step 1: Provide a summary of your problem

  • For general technical questions, problems or feature requests related to the code in this repository file an issue.

Step 2: Provide tmuxp details

  • Include output of tmuxp debug-info
  • Include any other pertinant system info not captured

Step 3: Describe the problem:

Steps to reproduce:




Observed Results:

  • What happened? This could be a description, log output, etc.

Expected Results:

  • What did you expect to happen?

Relevant Code:

// TODO(you): paste here tmuxp configuration (YAML / JSON) you are having issues with.

tony avatar Feb 24 '21 17:02 tony

Is this intended to be a general feature for environment configuration or only window_name?

Right now it seems it only applies to shell command configuration. I tested {Session,Window} / start_directory.

What I thought would be the behavior of environment was to act exactly like passing env vars (or using env): before any processing, it sets env var values to the configured values and wherever env vars expansion is accepted, it should expand to the configured values.

I don't know the current behavior, but it should also override actual env vars.

With popularity of configuration via env vars in 12-factor apps, libraries (most are named dotenv something) started being created that implement this behavior: 1) boot (import dependencies, etc); 2) first thing done is to load env file with variable values; 3) values are used in app transparently (like they were inherited from parent process).

13k avatar Jul 01 '21 23:07 13k