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

Task doesn't respect use_new_terminal=false if terminal has been moved #21144

Open
1 task done
casperhart opened this issue Nov 24, 2024 · 3 comments
Open
1 task done
Labels
bug [core label] panel Feedback for panels. Panels are the content that fills the docks. tasks terminal Feedback for terminal integration, shell commands, etc

Comments

@casperhart
Copy link

casperhart commented Nov 24, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

As an example, take Zed's clippy task, which has use_new_terminal=false:

  1. running task::Spawn --> clippy, the task opens in a terminal at the bottom of the window. Rerunning the task will reuse the same terminal as expected.
  2. Move the terminal created by the clippy task from the bottom of the window to the right of the window
  3. Rerun the clippy task. This creates a new terminal at the bottom of the window. Expected behaviour is to reuse the terminal which is now on the right hand side, rather than creating a new terminal on the bottom.

Screenshot:
image

Note that there are two clippy task terminals, when this task should have reused the same terminal.

Environment

Zed: v0.162.5 (Zed)
OS: macOS 14.1.0
Memory: 36 GiB
Architecture: aarch64

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

No response

If applicable, attach your Zed.log file to this issue.

Zed.log

@casperhart casperhart added admin read bug [core label] labels Nov 24, 2024
@notpeter notpeter added terminal Feedback for terminal integration, shell commands, etc tasks panel Feedback for panels. Panels are the content that fills the docks. and removed triage labels Nov 25, 2024
@casperhart
Copy link
Author

I had a go at fixing this but it's not quite working how I'd like. (code here: https://github.com/casperhart/zed/tree/task-terminal).

The issue was that the function terminals_for_task in terminal_panel.rs will only check the 'terminals' pane for existing terminals for the given task, so once a terminal is moved out of that pane it's no longer seen.

I was able to get it working by looking at all panes in the workspace, however, while the task spawns in the correct terminal, a new terminal still gets created in the terminals pane. I haven't yet figured out why this is.

@jansol
Copy link
Contributor

jansol commented Dec 19, 2024

Ran into this as well, it's especially annoying for tasks like clippy or (in my case) rebuilding the project where you mainly care about the "OK" at the end and want a quick button for rerunning the task from the GUI. Having a full terminal pane open takes way more space than is needed there.

@calebmeyer
Copy link

Also ran into this:
I am following a bevy tutorial (rust game engine), and put bacon in my regular terminal, but hit the play button to do the cargo run in a second "terminal". When I hit rerun, it constantly spins up a new terminal pane at the bottom:

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] panel Feedback for panels. Panels are the content that fills the docks. tasks terminal Feedback for terminal integration, shell commands, etc
Projects
None yet
Development

No branches or pull requests

4 participants