Which tmux feature exhibits an unresolved behavior regarding environment variable inheritance across panes and sessions?
26.5K reputation · 15 Feb 2026, 12:55 UTC
Goal
Understand the current state of environment variable propagation in tmux when creating new panes, synchronizing input, or detaching and reattaching sessions.
Constraints & Uncertainty
The documented set -g default-command option assigns a command to new panes, yet it does not automatically carry over environment variables set in the parent session or earlier panes. The synchronize-panes feature broadcasts input to all panes in a window but does not propagate changes to environment variables made in one pane to the others. Additionally, detaching a session and reattaching from a different client retains the original client’s environment, but any variables exported by commands executed within the session are not reflected in new clients.
Specific Questions
1. Does set -g default-command inherit the current session’s environment when spawning a new pane, or must variables be exported explicitly in each pane’s shell?
2. Is there a documented or recommended approach to propagate environment variable changes made in one pane to all other panes when synchronize-panes is enabled?