From c6665c28c3b351a3f3da6ba6df78b3e96aefdb99 Mon Sep 17 00:00:00 2001 From: Thomas Kosiewski Date: Fri, 10 Apr 2026 17:24:29 +0000 Subject: [PATCH] fix: trust mise config in mux workspace hooks --- .mux/init | 9 +++++++++ .mux/tool_env | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/.mux/init b/.mux/init index 7bb1c30..95f322a 100755 --- a/.mux/init +++ b/.mux/init @@ -22,7 +22,16 @@ if [ -z "$_mux_mise_bin" ]; then fi echo "[mux:init] using mise at $_mux_mise_bin" + +_mux_mise_config="$PWD/mise.toml" +if [ -f "$_mux_mise_config" ]; then + # Worktree workspaces live at unique paths, so mise treats each workspace copy + # as a newly untrusted config until it is explicitly trusted. + "$_mux_mise_bin" trust -y "$_mux_mise_config" >/dev/null 2>&1 || true +fi + "$_mux_mise_bin" install "$_mux_mise_bin" run bootstrap unset _mux_mise_bin +unset _mux_mise_config diff --git a/.mux/tool_env b/.mux/tool_env index 0a95f83..09dd18d 100644 --- a/.mux/tool_env +++ b/.mux/tool_env @@ -14,7 +14,15 @@ elif [ -x "/usr/local/bin/mise" ]; then fi if [ -n "$_mux_mise_bin" ]; then + _mux_mise_config="$PWD/mise.toml" + if [ -f "$_mux_mise_config" ]; then + # New worktree paths start untrusted, and bash commands may run before the + # async init hook finishes trusting the copied mise.toml. + "$_mux_mise_bin" trust -y "$_mux_mise_config" >/dev/null 2>&1 || true + fi + eval "$("$_mux_mise_bin" activate bash --shims 2>/dev/null)" || true fi unset _mux_mise_bin +unset _mux_mise_config