# \`pixi shell\` blocks

**URL:** <https://universal-blue.discourse.group/t/pixi-shell-blocks/6815>\
**Category:** Bluefin\
**Created:** [February 12, 2025, 8:46pm UTC](https://universal-blue.discourse.group/t/pixi-shell-blocks/6815 "2025-02-12T20:46:43Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![phreed](https://yyz2.discourse-cdn.com/free1/user_avatar/universal-blue.discourse.group/phreed/32/2417_2.png) [@phreed](https://universal-blue.discourse.group/u/phreed)\
**Post date:** [February 12, 2025, 8:46pm UTC](https://universal-blue.discourse.group/t/pixi-shell-blocks/6815/1 "2025-02-12T20:46:43Z")

</div>

- Reopen [Ptyxis does not play well with pixi](https://universal-blue.discourse.group/t/ptyxis-does-not-play-well-with-pixi/3533)
- See [Bluefin LTS (Alpha) for ARM - #15 by phreed](https://universal-blue.discourse.group/t/bluefin-lts-alpha-for-arm/6545/15)

When activating a pixi environment via `pixi shell` the terminal blocks.  
It does not produce a prompt.  
It does not respond to keyboard input (including Ctrl-C and Ctrl-Z).  
The running pixi process does respond to several interrupts:  
e.g.  
`kill -s STOP PID`  
Backgrounds the process; then the terminal responds to input but it still does not show any sign of handling those inputs.

Here is a trace from running: `pixi shell -vvv`

```plaintext
 INFO pixi_manifest::discovery: Found manifest in directory: "/var/home/phreed/Projects/cts-3.x", continuing further.
DEBUG pixi_config: Loading config from /etc/pixi/config.toml
DEBUG pixi_config: Loading config from /var/home/phreed/.config/pixi/config.toml
DEBUG pixi_config: Loading config from /var/home/phreed/.pixi/config.toml
DEBUG pixi_config: Loading config from /var/home/phreed/Projects/cts-3.x/.pixi/config.toml
DEBUG pixi_config: Failed to load local config: /var/home/phreed/Projects/cts-3.x/.pixi/config.toml (error: no file was found at /var/home/phreed/Projects/cts-3.x/.pixi/config.toml)
 INFO pixi::environment: verifying prefix location is unchanged, with prefix file: /var/home/phreed/Projects/cts-3.x/.pixi/envs/conda-meta/pixi_env_prefix
 INFO pixi::lock_file::update: the lock-file is up-to-date
 INFO pixi::lock_file::update: Environment 'default' is up-to-date with lock file hash
DEBUG pixi::activation: Running activation script for Default
DEBUG pixi::cli::shell: Pixi environment activation:
{"PIXI_ENVIRONMENT_NAME": "default", "PROJECT_DIR": "/var/home/phreed/Projects/cts-3.x", "PIXI_PROMPT": "(cts-3.x) ", "GSETTINGS_SCHEMA_DIR_CONDA_BACKUP": "", "PIXI_PROJECT_NAME": "cts-3.x", "PIXI_PROJECT_VERSION": "0.1.0", "JAVA_HOME": "/var/home/phreed/Projects/cts-3.x/.pixi/envs/default/lib/jvm", "GSETTINGS_SCHEMA_DIR": "/var/home/phreed/Projects/cts-3.x/.pixi/envs/default/share/glib-2.0/schemas", "CONDA_DEFAULT_ENV": "cts-3.x", "PIXI_PROJECT_ROOT": "/var/home/phreed/Projects/cts-3.x", "PATH": "/var/home/phreed/Projects/cts-3.x/.pixi/envs/default/bin:/var/home/phreed/.pixi/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/var/home/phreed/.local/bin:/var/home/phreed/bin:/usr/lib64/ccache:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/var/home/phreed/.local/share/JetBrains/Toolbox/scripts:/var/home/phreed/.local/share/JetBrains/Toolbox/scripts", "PIXI_ENVIRONMENT_PLATFORMS": "linux-64", "CONDA_PREFIX": "/var/home/phreed/Projects/cts-3.x/.pixi/envs/default", "JAVA_LD_LIBRARY_PATH": "/var/home/phreed/Projects/cts-3.x/.pixi/envs/default/lib/jvm/lib/server", "PIXI_EXE": "/var/home/phreed/.pixi/bin/pixi", "PIXI_PROJECT_MANIFEST": "/var/home/phreed/Projects/cts-3.x/pixi.toml", "PIXI_IN_SHELL": "1"}
DEBUG rattler_shell::shell: Guessing the current shell is bash. Parent process name: bash and args: []
 INFO pixi::cli::shell: Starting shell: Bash(Bash)

```

The last message I see is produced here:

> <https://github.com/prefix-dev/pixi/blob/fc3e1a861deac099e51f7f0c3eaa2f64e217d4bf/src/cli/shell.rs>

Following that the `start_unix_shell` function is called where a tempfile is created.

> <https://github.com/prefix-dev/pixi/blob/fc3e1a861deac099e51f7f0c3eaa2f64e217d4bf/src/cli/shell.rs#L141-L146>

I do see `/tmp/pixi_env_*.sh` files being created.

Here is the contents of an examplar:

```bash
export PIXI_PROJECT_VERSION="0.1.0"
export CONDA_DEFAULT_ENV="cts-3.x"
export PIXI_PROJECT_MANIFEST="/var/home/phreed/Projects/cts-3.x/pixi.toml"
export PATH="/var/home/phreed/Projects/cts-3.x/.pixi/envs/default/bin:/var/home/phreed/.pixi/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/var/home/phreed/.local/bin:/var/home/phreed/bin:/usr/lib64/ccache:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/var/home/phreed/.local/share/JetBrains/Toolbox/scripts:/var/home/phreed/.local/share/JetBrains/Toolbox/scripts"
export PIXI_PROJECT_ROOT="/var/home/phreed/Projects/cts-3.x"
export JAVA_LD_LIBRARY_PATH="/var/home/phreed/Projects/cts-3.x/.pixi/envs/default/lib/jvm/lib/server"
export CONDA_PREFIX="/var/home/phreed/Projects/cts-3.x/.pixi/envs/default"
export PIXI_ENVIRONMENT_NAME="default"
export JAVA_HOME="/var/home/phreed/Projects/cts-3.x/.pixi/envs/default/lib/jvm"
export PIXI_EXE="/var/home/phreed/.pixi/bin/pixi"
export PIXI_IN_SHELL="1"
export PROJECT_DIR="/var/home/phreed/Projects/cts-3.x"
export GSETTINGS_SCHEMA_DIR="/var/home/phreed/Projects/cts-3.x/.pixi/envs/default/share/glib-2.0/schemas"
export PIXI_ENVIRONMENT_PLATFORMS="linux-64"
export PIXI_PROJECT_NAME="cts-3.x"
export GSETTINGS_SCHEMA_DIR_CONDA_BACKUP=""
export PIXI_PROMPT="(cts-3.x) "
echo '=== DONE ==='
export PS1="(cts-3.x) ${PS1:-}"
# shellcheck shell=bash
pixi() {
    local first_arg="$1"
    local cmd="$PIXI_EXE $*"

    eval "$cmd"

    case "$first_arg" in
        add|a|remove|rm|install|i)
            eval "$($PIXI_EXE shell-hook --change-ps1 false)"
            hash -r
            ;;
    esac
}

```

This would indicate it gets at least this far.

> <https://github.com/prefix-dev/pixi/blob/fc3e1a861deac099e51f7f0c3eaa2f64e217d4bf/src/cli/shell.rs#L161>

---

<div class="post-metadata">

**Author:** ![wolfv](https://yyz2.discourse-cdn.com/free1/user_avatar/universal-blue.discourse.group/wolfv/32/5251_2.png) [@wolfv](https://universal-blue.discourse.group/u/wolfv)\
**Post date:** [February 13, 2025, 10:40am UTC](https://universal-blue.discourse.group/t/pixi-shell-blocks/6815/2 "2025-02-13T10:40:49Z")

</div>

Hi @phreed thank you for bringing this to our attention (speaking as a pixi developer). We would love to fix this.

Could there be a restriction to execute / source files from the temp folder in Bluefin?

Is there an easy way for us to debug this locally?

---

<div class="post-metadata">

**Author:** ![wolfv](https://yyz2.discourse-cdn.com/free1/user_avatar/universal-blue.discourse.group/wolfv/32/5251_2.png) [@wolfv](https://universal-blue.discourse.group/u/wolfv)\
**Post date:** [February 13, 2025, 3:02pm UTC](https://universal-blue.discourse.group/t/pixi-shell-blocks/6815/3 "2025-02-13T15:02:20Z")

</div>

I opened a PR here: [fix: flush shell activation file after writing and add some debug info by wolfv · Pull Request #3130 · prefix-dev/pixi · GitHub](https://github.com/prefix-dev/pixi/pull/3130) and you can grab the linux-x64 binary from CI here: [https://github.com/prefix-dev/pixi/actions/runs/13309032492/artifacts/2585894310](https://github.com/prefix-dev/pixi/actions/runs/13309032492/artifacts/2585894310)

Is that something that can help? Or do you need the linux-aarch64 ones?

---

<div class="post-metadata">

**Author:** ![phreed](https://yyz2.discourse-cdn.com/free1/user_avatar/universal-blue.discourse.group/phreed/32/2417_2.png) [@phreed](https://universal-blue.discourse.group/u/phreed)\
**Post date:** [February 13, 2025, 6:01pm UTC](https://universal-blue.discourse.group/t/pixi-shell-blocks/6815/4 "2025-02-13T18:01:10Z")

</div>

It appears that the problem is due to an interaction with `starship`.  
I commented out the following at the end of `/etc/bashrc`

```bash
eval "$(starship init bash)"

```

Now pixi shell behaves as advertised.

> **[Starship: Cross-Shell Prompt](https://starship.rs/)**
>
> Starship is the minimal, blazing fast, and extremely customizable prompt for any shell! Shows the information you need, while staying sleek and minimal. Quick installation available for Bash, Fish, ZSH, Ion, Tcsh, Elvish, Nu, Xonsh, Cmd, and...

---

<div class="post-metadata">

**Author:** ![j0rge](https://yyz2.discourse-cdn.com/free1/user_avatar/universal-blue.discourse.group/j0rge/32/8_2.png) [@j0rge](https://universal-blue.discourse.group/u/j0rge)\
**Post date:** [February 13, 2025, 6:14pm UTC](https://universal-blue.discourse.group/t/pixi-shell-blocks/6815/5 "2025-02-13T18:14:30Z")

</div>

> [@wolfv](#):
>
> We would love to fix this.

Thanks for the assist, please let me know if there’s anything we need to do on our end to make the experience better! Thanks for working on pixi!

---

<div class="post-metadata">

**Author:** ![phreed](https://yyz2.discourse-cdn.com/free1/user_avatar/universal-blue.discourse.group/phreed/32/2417_2.png) [@phreed](https://universal-blue.discourse.group/u/phreed)\
**Post date:** [February 13, 2025, 6:33pm UTC](https://universal-blue.discourse.group/t/pixi-shell-blocks/6815/6 "2025-02-13T18:33:19Z")

</div>

It looks like @wolfv has fixed the issue. 🎇

---

<div class="post-metadata">

**Author:** ![wolfv](https://yyz2.discourse-cdn.com/free1/user_avatar/universal-blue.discourse.group/wolfv/32/5251_2.png) [@wolfv](https://universal-blue.discourse.group/u/wolfv)\
**Post date:** [February 13, 2025, 7:08pm UTC](https://universal-blue.discourse.group/t/pixi-shell-blocks/6815/7 "2025-02-13T19:08:15Z")

</div>

Awesome, thank you for testing! This one was our fault! 🙂

---

<div class="post-metadata">

**Author:** ![phreed](https://yyz2.discourse-cdn.com/free1/user_avatar/universal-blue.discourse.group/phreed/32/2417_2.png) [@phreed](https://universal-blue.discourse.group/u/phreed)\
**Post date:** [February 13, 2025, 7:09pm UTC](https://universal-blue.discourse.group/t/pixi-shell-blocks/6815/8 "2025-02-13T19:09:58Z")

</div>

Have you thought about using `pixi` instead of `brew` on `x86` as well as `arm`?

---

<div class="post-metadata">

**Author:** ![salim](https://yyz2.discourse-cdn.com/free1/user_avatar/universal-blue.discourse.group/salim/32/3536_2.png) [@salim](https://universal-blue.discourse.group/u/salim)\
**Post date:** [February 13, 2025, 7:18pm UTC](https://universal-blue.discourse.group/t/pixi-shell-blocks/6815/9 "2025-02-13T19:18:35Z")

</div>

I have no experience with pixi yet and not the breath to figure out myself right now, so I just dare to ask: Any chance pixi would be more polite regarding [`PATH` pollution](https://universal-blue.discourse.group/t/default-path-hierarchy-homebrew-and-user-binaries/4243) than Homebrew?

---

<div class="post-metadata">

**Author:** ![phreed](https://yyz2.discourse-cdn.com/free1/user_avatar/universal-blue.discourse.group/phreed/32/2417_2.png) [@phreed](https://universal-blue.discourse.group/u/phreed)\
**Post date:** [February 13, 2025, 7:40pm UTC](https://universal-blue.discourse.group/t/pixi-shell-blocks/6815/10 "2025-02-13T19:40:52Z")

</div>

Maybe, `pixi` has several features that may help.  
To start `pixi` places its global directory at the start of the PATH much like `brew`.  
With `pixi` a package is either added to a project or installed globally.  
To mimic `brew` behavior you would do a global install.  
When doing a global install you can decide what to expose and how it is to be exposed.  
Thus, if the default exposed function conflicts with a system function you can give it a distinct name.  
If there is already a matching exposed name the install fails.  
Here is an example where a previously installed package has the same exposed name.  
e.g.

```bash
❯ pixi global install starship
Error: 
  × Couldn't install starship
  ╰─▶ Exposed name starship already exists

```

> **[prefix.dev – solving software package management](https://prefix.dev/blog/pixi_global)**
>
> The software package management platform for Python, C++, R, Rust and more

For more detail I defer to @wolfv .

---

<div class="post-metadata">

**Author:** ![salim](https://yyz2.discourse-cdn.com/free1/user_avatar/universal-blue.discourse.group/salim/32/3536_2.png) [@salim](https://universal-blue.discourse.group/u/salim)\
**Post date:** [February 13, 2025, 8:10pm UTC](https://universal-blue.discourse.group/t/pixi-shell-blocks/6815/11 "2025-02-13T20:10:45Z")

</div>

> [@phreed](#):
>
> When doing a global install you can decide what to expose and how it is to be exposed.

The problem with Homebrew is that it also exposes (transitive) dependencies to the global `PATH` if they’re required by the installed tool. Does pixi manage to avoid that (by “sandboxing” the installed tool somehow)?

---

<div class="post-metadata">

**Author:** ![wolfv](https://yyz2.discourse-cdn.com/free1/user_avatar/universal-blue.discourse.group/wolfv/32/5251_2.png) [@wolfv](https://universal-blue.discourse.group/u/wolfv)\
**Post date:** [February 13, 2025, 8:24pm UTC](https://universal-blue.discourse.group/t/pixi-shell-blocks/6815/12 "2025-02-13T20:24:49Z")

</div>

Yes, pixi does exactly that. When you globally install a tool, you create individual environments for each tool, and we only expose the executables from the package that you are interested in. This is completely controllable via the “global manifest file”.

```toml
version = 1
[envs.coreutils]
channels = ["conda-forge"]
dependencies = { coreutils = "*" }
exposed = { tee = "tee", md5sum = "md5sum", split = "split", cat = "cat", shuf = "shuf", mkfifo = "mkfifo", pathchk = "pathchk", runcon = "runcon", expand = "expand", tty = "tty", basename = "basename", install = "install", nice = "nice", truncate = "truncate", echo = "echo", du = "du", ptx = "ptx", join = "join", pwd = "pwd", test = "test", csplit = "csplit", sort = "sort", whoami = "whoami", touch = "touch", unlink = "unlink", b2sum = "b2sum", sleep = "sleep", fmt = "fmt", stty = "stty", logname = "logname", chgrp = "chgrp", printenv = "printenv", seq = "seq", uname = "uname", sha224sum = "sha224sum", od = "od", date = "date", base64 = "base64", realpath = "realpath", readlink = "readlink", dircolors = "dircolors", timeout = "timeout", tac = "tac", numfmt = "numfmt", wc = "wc", basenc = "basenc", comm = "comm", nproc = "nproc", expr = "expr", cksum = "cksum", printf = "printf", groups = "groups", chcon = "chcon", factor = "factor", tail = "tail", env = "env", pr = "pr", head = "head", kill = "kill", uniq = "uniq", stat = "stat", link = "link", sum = "sum", tsort = "tsort", mknod = "mknod", users = "users", dd = "dd", who = "who", sha1sum = "sha1sum", mktemp = "mktemp", cut = "cut", sha256sum = "sha256sum", dir = "dir", mkdir = "mkdir", nl = "nl", shred = "shred", fold = "fold", rmdir = "rmdir", sha384sum = "sha384sum", mv = "mv", dirname = "dirname", id = "id", base32 = "base32", pinky = "pinky", ln = "ln", hostid = "hostid", chroot = "chroot", ls = "ls", true = "true", cp = "cp", sync = "sync", yes = "yes", unexpand = "unexpand", chown = "chown", chmod = "chmod", uptime = "uptime", rm = "rm", vdir = "vdir", false = "false", sha512sum = "sha512sum", "[" = "[", tr = "tr", paste = "paste", nohup = "nohup" }

[envs.git-lfs]
channels = ["conda-forge"]
dependencies = { git-lfs = "*" }
exposed = { git-lfs = "git-lfs" }

```

You can modify the file by hand or use `pixi global install foobar`

The exposed binaries can also be renamed - which allows you to install multiple versions side by side (for example, you could type `exposed = { git-lfs-old = "git-lfs" }`).

Unlike Homebrew, pixi (or really the conda ecosystem) also comes with a SAT solver and old versions are never deleted. That means you can still install `python=3.5` or whatever.

Pixi also does not care _where_ you put it on the PATH 🙂

---

<div class="post-metadata">

**Author:** ![wolfv](https://yyz2.discourse-cdn.com/free1/user_avatar/universal-blue.discourse.group/wolfv/32/5251_2.png) [@wolfv](https://universal-blue.discourse.group/u/wolfv)\
**Post date:** [February 13, 2025, 8:25pm UTC](https://universal-blue.discourse.group/t/pixi-shell-blocks/6815/13 "2025-02-13T20:25:22Z")

</div>

Note that you can also have multiple packages in a single environment, which is particularly useful when you have plugins and the likes 🙂

---

<div class="post-metadata">

**Author:** ![salim](https://yyz2.discourse-cdn.com/free1/user_avatar/universal-blue.discourse.group/salim/32/3536_2.png) [@salim](https://universal-blue.discourse.group/u/salim)\
**Post date:** [February 13, 2025, 8:45pm UTC](https://universal-blue.discourse.group/t/pixi-shell-blocks/6815/14 "2025-02-13T20:45:13Z")

</div>

That sounds really promising!

@j0rge What’s your sentiment regarding [Provide `pixi` Out-of-the-Box](https://universal-blue.discourse.group/t/provide-pixi-out-of-the-box/6850)?

---

<div class="post-metadata">

**Author:** ![j0rge](https://yyz2.discourse-cdn.com/free1/user_avatar/universal-blue.discourse.group/j0rge/32/8_2.png) [@j0rge](https://universal-blue.discourse.group/u/j0rge)\
**Post date:** [February 13, 2025, 9:41pm UTC](https://universal-blue.discourse.group/t/pixi-shell-blocks/6815/15 "2025-02-13T21:41:58Z")

</div>

> [@salim](#):
>
> What’s your sentiment regarding [Provide `pixi` Out-of-the-Box](https://universal-blue.discourse.group/t/provide-pixi-out-of-the-box/6850)?

You mean like this? 😄

> <https://github.com/ublue-os/bluefin/issues/2206>
>
> First class access to the conda ecosystem has become more important for us (AI t…ools, etc). We ship this in lts already: https://github.com/ublue-os/bluefin-lts/blob/main/build\_scripts/overrides/aarch64/05-pixi.sh
> 
> Also upstream is engaged with helping out a user on our forums and that's awesome. Docs bullet will read something like:
> 
> \- Pixi for integrated conda support
> 
> Or whatever upstream feels is a more apt description.

For all the minutea (adding update support etc) please file issues in the bluefin repo and we can tighten it up before F42. We can certainly add it now though.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/univeral_blue/original/2X/e/e39f7d1952979cf23b0f8d634e025fb38da50026.png) [@system](https://universal-blue.discourse.group/u/system)\
**Post date:** [May 14, 2025, 9:42pm UTC](https://universal-blue.discourse.group/t/pixi-shell-blocks/6815/16 "2025-05-14T21:42:36Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
