Vscode: Task input variables always show default value instead of remembering the last value

Created on 27 Apr 2019  路  4Comments  路  Source: microsoft/vscode


  • VSCode Version: 1.33.1
  • OS Version: Windows 10 1809

Steps to Reproduce:

  1. Create a tasks.json file with a task that uses an input variable of say "promptString" and set it's default value to something.
  2. Invoking the script for the first populates with the default value - good so far.
  3. Change the value to something else.
  4. Invoke the task again and it gives the default instead of the last value entered. That is very annoying.

If this is the defined behavior of default then maybe we need another field initialDefault or something like that that provides a default when there is no stored value.

Perhaps I'm spoiled by using picker UI for debug launch configs. Those remember state even between VSCode invocations IIRC.


Does this issue occur when all extensions are disabled?: Yes

*duplicate feature-request tasks

Most helpful comment

+1 for this -- the input variables for tasks are fantastic but it would be huge if it could just remember my last selection

All 4 comments

+1 for this -- the input variables for tasks are fantastic but it would be huge if it could just remember my last selection

I would vote for a boolean field rememberValue, since this behavior is also needed, when no default is specified.

In my case, I have a build or run-task which get's the project name as a parameter. When I am working on a specific project, I usually need to build / run it several times. In this case, it would be cool, if the last entered value is used as a default.
In my opinion this value could be cleared on exit, similar to the ${string_prompt} in Eclipse Launch Configurations

It would be nicer to have this built into VS Code, but since it's not yet, I wrote an extension that I think does what you want: https://marketplace.visualstudio.com/items?itemName=spadin.memento-inputs

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sijad picture sijad  路  3Comments

omidgolparvar picture omidgolparvar  路  3Comments

borekb picture borekb  路  3Comments

vsccarl picture vsccarl  路  3Comments

chrisdias picture chrisdias  路  3Comments