Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add tip for conditional shims using TERM_PROGRAM #2770

Merged
merged 2 commits into from
Oct 17, 2024

Conversation

htunnicliff
Copy link
Contributor

@htunnicliff htunnicliff commented Oct 16, 2024

I added a tip explaining how to use the TERM_PROGRAM environment variable to conditionally use shim-based activation.


For background, I use zsh and have my .zprofile configured to activate mise like so:

eval "$($HOME/.local/bin/mise activate zsh)"

However, as these docs already mention, IDEs such as VSCode don't always function as expected unless mise is activated with --shims.

To get the best of both worlds, mise activation can be conditionally modified if terminal detection is used, which is what I added to the docs:

# ~/.zprofile
if [[ "$TERM_PROGRAM" == "vscode" ]]; then
  eval "$($HOME/.local/bin/mise activate zsh --shims)"
elif; then
  eval "$($HOME/.local/bin/mise activate zsh)"
fi

@jdx jdx merged commit 6996e33 into jdx:main Oct 17, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants