Skip to content

Instantly share code, notes, and snippets.

@unlomtrois
Last active February 25, 2026 01:44
Show Gist options
  • Select an option

  • Save unlomtrois/db99e6adb72615186780ccc2f87284ae to your computer and use it in GitHub Desktop.

Select an option

Save unlomtrois/db99e6adb72615186780ccc2f87284ae to your computer and use it in GitHub Desktop.
nix-shell indicator in tmux
# ...
set -g status-left "[#S]#{?@nix-shell,#[fg=blue]  nix}"
# ...
# Update tmux pane option to reflect nix-shell status
if [[ -n "$TMUX" ]]; then
_update_tmux_nix_indicator() {
if [[ -n "$IN_NIX_SHELL" ]]; then
tmux set-option -qp @nix-shell "1"
else
tmux set-option -qp @nix-shell ""
fi
}
precmd_functions+=(_update_tmux_nix_indicator)
fi
@unlomtrois
Copy link
Author

Screenshot From 2026-02-25 04-41-13 Screenshot From 2026-02-25 04-43-18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment