Skip to content

flox activate prompting for rm in 1.9.0 #3984

@blalor

Description

@blalor

Describe the bug:

Inconsistent zsh dotfile processing, prompt to 'remove regular file' during activation.

Steps to reproduce:

  1. cd tmp && mkdir flox-test && cd flox-test
  2. flox --version1.9.0
  3. flox init (successful, nothing notable new from 1.8.4)
  4. env | grep -i floxPWD=/Users/blalor/tmp/flox-test; ie flox is not otherwise in play in this shell
  5. flox activate
    ✔ You are now using the environment 'flox-test'
    To stop using this environment, type 'exit'
    
    /Users/blalor/.config/zsh/.zshenv:11: command not found: _ztrace
    …
    rm: remove regular file '/Users/blalor/.cache/flox/run/activations/77308731-flox-test/cz6fk83vmxjwjlh94z8n5h9ydqyci05r-environment-develop.1770828367462/flox_rc_zsh_MCvzTq'?
    

Result:

as above

Expected:

flox activate sub-shell without prompts to remove a file or broken zsh config.

Commentary:

I have the following in ~/.zshenv:

# _zsh_trace=y
function _ztrace() {
    [ -n "${_zsh_trace:-}" ] && echo "[_ztrace] $*"
}

# $0 is '-zsh' instead of this filename
_ztrace "$0 (~/.zshenv; _zsh_trace set here)"

# the export is to make flox happy; it does its own shell shenanigans and
# without the export it can't see ZDOTDIR and therefore isn't picking up my
# customizations.
export ZDOTDIR=$HOME/.config/zsh

source ${ZDOTDIR}/.zshenv

Then in ${ZDOTDIR}/.zshenv there's this at line 11:

_ztrace "$0 ($ZDOTDIR/.zshenv)"

If I had to guess I'd say that the _ztrace function defined in ~/.zshenv isn't being persisted in the environment.

Flox Version (run flox --version if possible):

1.9.0

uname -a output:

Darwin CW-LGCPYDJ9HJ-L 25.2.0 Darwin Kernel Version 25.2.0: Tue Nov 18 21:09:56 PST 2025; root:xnu-12377.61.12~1/RELEASE_ARM64_T6041 arm64

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingteam-cliTickets relevant to the flox CLI team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions