tmux Troubleshooting and Debugging/Preserve selected environment variables

Update tmux with variables from the client environment.

Section: Common problems and fixes

Preserve selected environment variables

tmux
tmux
set -g update-environment "DISPLAY SSH_AUTH_SOCK SSH_AGENT_PID WINDOWID XAUTHORITY"
Explanation

Useful when SSH agent forwarding or GUI-related variables disappear after attaching.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Common problems and fixes
Set a modern default terminal
Use a terminal definition with 256-color/feature support.
OpenIn sheettmuxsame section
Restart the tmux server
Terminate the tmux server entirely.
OpenIn sheetbashsame section
Reload config with shell tracing
Verify config sourcing from a shell wrapper.
OpenIn sheetbashsame section
Show tmux environment
Inspect environment variables known to tmux.
OpenIn sheetbash2 tag match
Show global options
Inspect current global configuration.
OpenIn sheetbash1 tag match
Show window options
Inspect per-window settings.
OpenIn sheetbash1 tag match