# Is there a better way to manage getting the right user-console-bin-dir on PATH for running shells when upgrading Racket?

**URL:** <https://racket.discourse.group/t/is-there-a-better-way-to-manage-getting-the-right-user-console-bin-dir-on-path-for-running-shells-when-upgrading-racket/3203>\
**Category:** Questions & Answers\
**Tags:** racketcon2024\
**Created:** [October 7, 2024, 5:02pm UTC](https://racket.discourse.group/t/is-there-a-better-way-to-manage-getting-the-right-user-console-bin-dir-on-path-for-running-shells-when-upgrading-racket/3203 "2024-10-07T17:02:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![benknoble](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/benknoble/32/16_2.png) [@benknoble](https://racket.discourse.group/u/benknoble)\
**Post date:** [October 7, 2024, 5:02pm UTC](https://racket.discourse.group/t/is-there-a-better-way-to-manage-getting-the-right-user-console-bin-dir-on-path-for-running-shells-when-upgrading-racket/3203/1 "2024-10-07T17:02:24Z")

</div>

## Context

Continuing the conversation from `(fourteenth racketcon)` about releases and managing Racket versions:

When I install a new Racket version, I do the following:

- `brew upgrade --cask racket` (after `brew update`)

- `raco pkg migrate <old-version>`

- I then use tmux to send the following commands to all my open shells:

([Here's a tmux key-binding for sending a command to all panes](https://github.com/benknoble/Dotfiles/blob/18a520f713144a5ca8c64c6e038b1c5b97138997/links/tmux.conf#L106-L109), and [here are my shell definitions of `pathadd` and `pathrm` for Zsh](https://github.com/benknoble/Dotfiles/blob/18a520f713144a5ca8c64c6e038b1c5b97138997/links/zshenv#L78-L89). I have similar commands for Bash in that repo, though they're kludgier and I won't link them.)

These paths come from `setupdirs` with `find-user-console-bin-dir` and `find-user-man-dir` so that I have them on PATH, for example to have launchers available from user-scope installed packages.

The tmux part of this process requires making sure none of my tmux panes have a program running that isn't the shell, and can still break when a shell is in Normal mode (I use `bindkey -v` in Zsh similar to `set -o vi` in Bash). New shells [automatically get the right paths](https://github.com/benknoble/Dotfiles/blob/18a520f713144a5ca8c64c6e038b1c5b97138997/links/zsh/mac/paths.zsh#L18-L27).

I've looked at `/etc/paths.d`, but I think that only works for new shells, and I already have a solution for that.

## Question

Is there a better way for me to manage these path updates for _user_ directories?

Having a single place to point to ("current") would be nice and would probably fit with the "build `racketup` on top of `raco cross`." In the meantime, what do others do? Is there a workflow option I'm missing?

---

<div class="post-metadata">

**Author:** ![greghendershott](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/greghendershott/32/98_2.png) [@greghendershott](https://racket.discourse.group/u/greghendershott)\
**Post date:** [October 7, 2024, 7:02pm UTC](https://racket.discourse.group/t/is-there-a-better-way-to-manage-getting-the-right-user-console-bin-dir-on-path-for-running-shells-when-upgrading-racket/3203/2 "2024-10-07T19:02:15Z")

</div>

For testing Racket Mode against various versions of Racket that I have installed simultaneously, I'm mostly resigned to using explicit full `~/racket/VERSION/bin/racket` pathnames.

- I use the Racket install.sh on Linux.
- I don't use the "unix install" option; instead I install each version to its own own directory.
- In a Makefile I'll have a `RACKET` var, so I can `RACKET=path/to/racket make`.

I also build Racket from source (from time to time) and I tend to set `PATH` to be that, as my default for casual shell use. But mostly I'm "indirectly" running Racket from a Makefile or from Emacs, and the full pathname isn't a PITA.

* * *

For your scenario, instead of trying to update `PATH` vars in dozens of live shells, might it be less-worse to define some symbolic links for a half dozen things like `racket`, `raco`, `drracket`? Then you can just update those symlinks, and all the shells will just follow them?

Even if that works: I'm not sure how to deal with `man` (I rarely use that) but IIUC the man env var is just an override for the primary `manpath` command? So something hand-wavingly similar to the symlink approach could work for that??

---

<div class="post-metadata">

**Author:** ![samth](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/samth/32/3_2.png) [@samth](https://racket.discourse.group/u/samth)\
**Post date:** [October 7, 2024, 8:11pm UTC](https://racket.discourse.group/t/is-there-a-better-way-to-manage-getting-the-right-user-console-bin-dir-on-path-for-running-shells-when-upgrading-racket/3203/3 "2024-10-07T20:11:33Z")

</div>

I use this set of shell scripts to manage switching between versions of Racket: [GitHub - takikawa/racket-dev-goodies: Scripts for Racket developers](https://github.com/takikawa/racket-dev-goodies)

---

<div class="post-metadata">

**Author:** ![benknoble](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/benknoble/32/16_2.png) [@benknoble](https://racket.discourse.group/u/benknoble)\
**Post date:** [October 26, 2024, 5:21pm UTC](https://racket.discourse.group/t/is-there-a-better-way-to-manage-getting-the-right-user-console-bin-dir-on-path-for-running-shells-when-upgrading-racket/3203/4 "2024-10-26T17:21:10Z")

</div>

Thanks to Greg's symlink idea, here's what I have now: [symlinks `~/.racket-bin` and `~/.racket-man` that point to the appropriate directories](https://github.com/benknoble/Dotfiles/commit/1ed7b15259d04bf6d2eb722851485e57cf435837).

Note that these are not for `racket` binaries and documentation, but for user-scope packages's binaries and documentation. For example, Frosthaven Manager has a racket-launcher configured, so installing the package gets you a command-line `frosthaven-manager` that can run the program: that's the bin directory I want on PATH, and it changes with each version.
