Skip to content
Terminal

Environment integration

How Mel loads your shell environment, PATH tools, and env sets.


Commands in Mel run through your own shell ($SHELL on Unix, cmd.exe on Windows), and Mel goes out of its way to make sure they see the environment you expect — even when Mel itself was launched from a desktop icon with a bare environment.

Login-shell hydration at startup

A GUI app only inherits the environment of whatever launched it. Started from a desktop launcher or an IDE, that's often a minimal env — no nvm or pyenv shims, no PATH additions from your ~/.bashrc or ~/.zshrc, so tools like the claude or codex CLIs would be "command not found".

Mel fixes this the way editors do: at startup it runs your shell once as a login+interactive shell ($SHELL -l -i -c env) in the background, captures the resulting environment, and applies it to every command it runs from then on. Anything your shell rc exports — PATH entries, version-manager shims, tokens — is present regardless of how Mel was launched. The capture has a short timeout and is cached for the app's lifetime.

Per-pane overrides

On top of the hydrated base, each pane can layer its own environment:

  • Node version override — picking a version from the Node chip runs a visible nvm use vX block and prepends that version's bin directory to PATH for every subsequent command in the pane.
  • Environment sets from Mel Drive — Drive's environment-variable objects hold named sets whose values can come from a literal, a command, or a password manager (1Password / LastPass CLIs). Load resolves the values and exports the set into the active pane; from then on each command runs with those variables applied. Values are masked in the editor until you reveal them.

Overrides are strictly per-pane: the pane next to you in a split keeps its own environment.

Terminal identity

Interactive sessions (TUIs, ssh, CLI coding agents) run with TERM=xterm-256color, so remote and full-screen programs get correct color and capability answers.

PTY sizing

The PTY is opened at the pane's real column count, derived from the rendered width and the monospace glyph width — so column-oriented output like ls lays out to match what you see, not a default 80 columns.