zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
49.64k stars 3.04k forks source link

Using detect_venv using Nushell as default shell doesn't automatically execute the command #8970

Open Tom-Boscher opened 8 months ago

Tom-Boscher commented 8 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

When using nushell as default and detect_venv, the overlay use "/Users/tom/Desktop/test_venv_activate_script/.venv/bin/activate.nu" command is prompted but not executed, we have to manually hit enter.

Capture d’écran 2024-03-06 à 23 37 46

Otherwise using zsh the command is properly executed when a new terminal panel is opened.

Capture d’écran 2024-03-06 à 23 25 13

Environment

Zed: v0.126.0 (Zed Preview) OS: macOS 14.3.1 Memory: 16 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.

If you only need the most recent lines, you can run the zed: open log command palette action to see the last 1000.

No response

Moshyfawn commented 8 months ago

It seems similar to #8633. Do you think it's the same problem?

mrnugget commented 8 months ago

This is unrelated to #8633, which is about getting the right environment when launching language servers. This here is about launching a terminal.

Tom-Boscher commented 7 months ago
let Some(activate_script) = activate_script {
            // Paths are not strings so we need to jump through some hoops to format the command without `format!`
            let mut command = Vec::from(activate_command.as_bytes());
            command.push(b' ');
            // Wrapping path in double quotes to catch spaces in folder name
            command.extend_from_slice(b"\"");
            command.extend_from_slice(activate_script.as_os_str().as_encoded_bytes());
            command.extend_from_slice(b"\"");
            // Exectute the command
            command.push(b'\n');

            terminal_handle.update(cx, |this, _| this.input_bytes(command));
        }

This works fine for zsh but doesn't work for Nushell, I don't know why yet

Tom-Boscher commented 7 months ago

I didn't have time to run other tests but command.push(b'\n'); which add return to line to the vector to execute the command doesn't work for Nushell but works for zsh

github-actions[bot] commented 3 weeks ago

Hi there! 👋 We're working to clean up our issue tracker by closing older issues that might not be relevant anymore. Are you able to reproduce this issue in the latest version of Zed? If so, please let us know by commenting on this issue and we will keep it open; otherwise, we'll close it in 7 days. Feel free to open a new issue if you're seeing this message after the issue has been closed. Thanks for your help!

Tom-Boscher commented 3 weeks ago

I still have this issue