The "Task: Run Task" picker puts the most recently used task as the first one in the list (with other recently used tasks), which makes it easy to re-run the same task without typing.
The same behavior is not present for the input pickers (both "pickString" and "promptString" pickers), which makes it harder to re-run the same task if the arguments were not the default ones.
Consider the following tasks.json file:
{
"version": "2.0.0",
"tasks": [
{
"label": "echo free",
"type": "shell",
"command": "echo ${input:any}",
"problemMatcher": []
},
{
"label": "echo list",
"type": "shell",
"command": "echo ${input:list}",
"problemMatcher": []
}
],
"inputs": [
{
"id": "list",
"description": "arguments in a list",
"default": "a",
"type": "pickString",
"options": [ "a", "b", "c" ]
},
{
"id": "any",
"description": "any arg",
"default": "",
"type": "promptString"
}
]
}
If my development workflow requires me to run "echo list" with argument "c" frequently (i.e. building a specific module in a big project), I can quickly find the right task (it is likely at the top of the recently used tasks inside the Run Task picker), but I will still have to lookup or type the argument (and in my real-life use case, the argument is not a single letter, and the list has ~150 elements). Having a "recenty used input" list would be helpful for this.
The same goes for a "echo free"-like task (I have this case passing custom arguments to a build system script, as I would do in a shell, but with a problemMatcher parsing the output), but as the arguments are not selected from a list, the number of "recently used inputs" would probably have to be limited to a sane level.
(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:
There's a Rerun Last Task command, where if you set the task's "runOptions": { "reevaluateOnRerun": false} you'll be able to run the last task with the same input. I know that's not quite what you're asking for here, but it might help for now.
I did know about Rerun last task, but didn't know about the runOptions part. That will help for a lot of my use cases ;)
I also needed that functionality, for now the reevaluateOnRerun setting is fine, thanks !
Here it is May 2020 and this feature is still not available? I have a use-case which needs the selection of the user to be remembered. In our case we need to get the branch name to update from git, but each user of the tasks.json may be working on other branches. We should be able to remember the last value used to avoid having the user re-select the branch.
Most helpful comment
There's a Rerun Last Task command, where if you set the task's
"runOptions": { "reevaluateOnRerun": false}you'll be able to run the last task with the same input. I know that's not quite what you're asking for here, but it might help for now.