zed icon indicating copy to clipboard operation
zed copied to clipboard

Opening terminal with Python file open calls the wrong venv activation script in fish

Open shahamran opened this issue 1 year ago • 2 comments

Check for existing issues

  • [X] Completed

Describe the bug / provide steps to reproduce it

Seems like zed is trying to activate a relevant virtual environment when opening a terminal with a Python file focused. When the interactive shell is fish, the .venv/bin/activate script is the wrong choice, the correct script is .venv/bin/activate.fish.

Environment

Zed: v0.132.5 (Zed) OS: macOS 14.4.1 Memory: 32 GiB Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

No response

shahamran avatar May 01 '24 07:05 shahamran

Hey @shahamran, check the the settings for activate_script here:

"terminal": {
  "detect_venv": {
    "on": {
      // Default directories to search for virtual environments, relative
      // to the current working directory. We recommend overriding this
      // in your project's settings, rather than globally.
      "directories": [
        ".env",
        "env",
        ".venv",
        "venv"
      ],
      // Can also be 'csh', 'fish', and `nushell`
      "activate_script": "default"
    }
  }
}

Does changing that setting to fish fix your issue?

JosephTLyons avatar May 03 '24 18:05 JosephTLyons

Thanks for the reply. Yes, manually changing this to fish works. I think zed should detect that my login shell is fish and do it automatically, no?

Also, the detect_venv setting should be inside the terminal setting, for future reference :)

shahamran avatar May 05 '24 07:05 shahamran