jdx / mise

dev tools, env vars, task runner
https://mise.jdx.dev
MIT License
10.24k stars 294 forks source link

Problem when used with AppImage #2639

Open vinismarques opened 2 months ago

vinismarques commented 2 months ago

Describe the bug I am using Cursor.AI (VSCode-based) to develop and mise does not work when my shell is Zsh.

To Reproduce

  1. Add eval "$(mise activate zsh)" on the zshrc file
  2. Set Cursor to use Zsh as default shell
  3. Open a project that uses node and try using the integrated terminal. It will open two new unsaved tabs/files in the current window called "activate", and "zsh".

Expected behavior Shell should be set to the correct node version.

mise doctor output

version: 2024.9.7 linux-x64 (743b7a7 2024-09-23)
activated: yes
shims_on_path: no

build_info: 
  Target: x86_64-unknown-linux-gnu
  Features: DEFAULT, NATIVE_TLS, OPENSSL
  Built: Mon, 23 Sep 2024 21:09:00 +0000
  Rust Version: rustc 1.81.0 (eeb90cda1 2024-09-04)
  Profile: release

shell: 
  /usr/bin/zsh
  zsh 5.9 (x86_64-pc-linux-gnu)

dirs: 
  data: ~/.local/share/mise
  config: ~/.config/mise
  cache: ~/.cache/mise
  state: ~/.local/state/mise
  shims: ~/.local/share/mise/shims

config_files: 
  ~/.config/mise/config.toml
  ~/.mise.toml

backends: 
  cargo
  core
  go
  npm
  pipx
  spm
  ubi
  vfox

plugins: 

toolset: 
  node@20.12.1  

env_vars: 
  MISE_SHELL=zsh

settings: 
  activate_aggressive = false
  all_compile = false
  always_keep_download = false
  always_keep_install = false
  asdf = true
  asdf_compat = false
  cache_prune_age = "30d"
  cargo_binstall = true
  color = true
  disable_default_shorthands = false
  disable_hints = []
  disable_tools = []
  experimental = false
  go_default_packages_file = "~/.default-go-packages"
  go_download_mirror = "https://dl.google.com/go"
  go_repo = "https://github.com/golang/go"
  go_set_gopath = false
  go_set_goroot = true
  go_skip_checksum = false
  http_timeout = 30
  jobs = 4
  legacy_version_file = true
  legacy_version_file_disable_tools = []
  libgit2 = true
  node_compile = false
  not_found_auto_install = true
  paranoid = false
  pipx_uvx = false
  plugin_autoupdate_last_check_duration = "7d"
  python_default_packages_file = "~/.default-python-packages"
  python_pyenv_repo = "https://github.com/pyenv/pyenv.git"
  raw = false
  trusted_config_paths = []
  quiet = false
  use_versions_host = true
  verbose = false
  vfox = false
  yes = false
  ci = false
  debug = false
  trace = false
  log_level = "info"
  python_venv_auto_create = false

  [ruby]
  default_packages_file = "~/.default-gems"
  ruby_build_repo = "https://github.com/rbenv/ruby-build.git"
  ruby_install = false
  ruby_install_repo = "https://github.com/postmodern/ruby-install.git"

  [status]
  missing_tools = "if_other_versions_installed"
  show_env = false
  show_tools = false

No warnings found
No problems found

Additional context I posted about it in https://github.com/jdx/mise/issues/921, but since that was closed before I commented, I figured I should open a new one.

Things I tried (Zsh):

  1. Using eval "$(mise activate zsh)" on the zshrc file: when starting a new integrated terminal on Cursor, it opens two new unsaved tabs/files in the current window called "activate", and "zsh".
  2. Using eval "$(mise activate --shims)": when starting a new integrated terminal on Cursor, it opens one new unsaved tab/file called "activate" in the current window and prints "Warning: 'shims' is not in the list of known options, but still passed to Electron/Chromium." to the terminal.
  3. Using export PATH="$HOME/.local/share/mise/shims:$PATH": does not open any weird tabs when starting a new integrated terminal, nor outputs any error/warning message to the terminal, but when I try something like node -v it opens a new Cursor window, instead of printing the version.
  4. Running mise doctor on the integrated terminal: opens unsaved file called "doctor".
  5. Running mise one two three on the integrated terminal: will open unsaved files called "one", "two", and "three" in the current window.
  6. Running just mise on the integrated terminal: opens a new IDE window.

On Bash, it seems to work fine with all methods... eval "$(mise activate bash)", eval "$(mise activate --shims)" and export PATH="$HOME/.local/share/mise/shims:$PATH". It prints the node version as expected when using node -v and does not open any weird tab or window.

I also have VSCode (non-AppImage), which Cursor is based on and it works with Zsh, so it seems something weird is going on only when using Zsh+AppImage.

smujaddid commented 4 days ago

I have the same problem, can't activate mise in integrated terminal of Cursor editor (AppImage) and ZSH.

mise ERROR cursor-0.42.5x86_64_3aad2fcb25d24d988a41f8c6ac0bc2f1.AppImage is not a valid shim
mise ERROR Run with --verbose or MISE_VERBOSE=1 for more information

It is working for bash only though.

smujaddid commented 2 days ago

I ended up extracting the Cursor AppImage and run Cursor from there. No more error when using mise, just like in the vscode.