Small improvements of the task terminal spawn behavior (#9399)

* Add a `reveal: always|never` field in task definitions from tasks.json
, allowing to customize task terminal behavior on spawn
* Ensure reveal: always reveals the terminal even if the old task is
already running


Release Notes:

- Added a `reveal: always|never` (`always` is a default) field in task
definitions from tasks.json , allowing to customize task terminal
behavior on spawn

---------

Co-authored-by: Piotr Osiewicz <piotr@zed.dev>
This commit is contained in:
Kirill Bulatov
2024-03-15 18:32:59 +02:00
committed by GitHub
co-authored by Piotr Osiewicz
parent 276139f792
commit dcdd1ece1c
6 changed files with 79 additions and 19 deletions
+4 -1
View File
@@ -2,7 +2,9 @@
use std::sync::Arc;
use crate::{SpawnInTerminal, Task, TaskContext, TaskId, TaskSource};
use crate::{
static_source::RevealStrategy, SpawnInTerminal, Task, TaskContext, TaskId, TaskSource,
};
use gpui::{AppContext, Context, Model};
/// A storage and source of tasks generated out of user command prompt inputs.
@@ -48,6 +50,7 @@ impl Task for OneshotTask {
env,
use_new_terminal: Default::default(),
allow_concurrent_runs: Default::default(),
reveal: RevealStrategy::default(),
})
}
}