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
48.16k stars 2.85k forks source link

support interactive input to tasks #18922

Open andrewbanchich opened 3 hours ago

andrewbanchich commented 3 hours ago

Check for existing issues

Describe the feature

i'd love to create a task like Pull package which allows me to write the name of a package so it can pull / build / some other things.

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

No response

SomeoneToIgnore commented 3 hours ago

Can you explain your use case, language and environment better?

Generally, tasks already support interactive input, e.g.

{
    "label": "test task with waiting",
    "command": "sh -c",
    "args": [
      "'echo -n \"Create database? [y/N] \"; read -n 1 answer; echo; [ \"$answer\" = \"y\" ] || [ \"$answer\" = \"Y\" ] && echo \"Creating DB...\" || echo \"Aborted\"'"
    ]
  },

on macOS will wait for Y or other input before continuing. Similarly, I can run some Python/Rust task that reads from stdin and it will work.