Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## [1.20.0] 2025-12-12

- Add extension setting to ignore focus out (#162)

## [1.19.1] 2025-07-02

- Fix empty string perceived when dismissing the popup (#151)
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,14 @@ There are a few limitations to be aware of:
* within an input command arg you can only reference other inputs defined with `shellCommand.execute`
* ensure you don't have another input with the same exact `inputs.args.command` in your tasks or launch configs as this may confuse the extension

## Settings

Settings for the extension that apply globally (not only to one task) use VSCode's settings mechanism.
Click `File` -> `Preferences` -> `Settings` -> `Extensions` -> `Tasks Shell Input`.

Available settings are:
- Ignore focus out in prompts

## Developing and contributing

Please see [./CONTRIBUTING.md](./CONTRIBUTING.md) for documentation on developing this extension.
Expand Down
26 changes: 20 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Tasks Shell Input",
"description": "Use shell commands as input for your tasks",
"icon": "icon.png",
"version": "1.19.1",
"version": "1.20.0",
"publisher": "augustocdias",
"repository": {
"url": "https://github.com/augustocdias/vscode-shell-command"
Expand Down Expand Up @@ -32,7 +32,16 @@
"command": "shellCommand.execute",
"title": "Execute shell command"
}
]
],
"configuration": {
"properties": {
"shellInput.ignoreFocusOut": {
"type": "boolean",
"default": false,
"description": "Ignore focus out in prompts"
}
}
}
},
"scripts": {
"vscode:prepublish": "npm run compile",
Expand Down
4 changes: 3 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ export function activate(this: any, context: vscode.ExtensionContext) {
const handlePromptString = async () => {
vscode.window.showWarningMessage(
'shellCommand.promptString is deprecated. Please use `${prompt}`.');
const inputValue = await vscode.window.showInputBox();
const config = vscode.workspace.getConfiguration("shellInput");
const ignoreFocusOut = config.get<boolean>("ignoreFocusOut") || false;
const inputValue = await vscode.window.showInputBox({ ignoreFocusOut });

return inputValue || '';
};
Expand Down
3 changes: 3 additions & 0 deletions src/lib/CommandHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,9 @@ export class CommandHandler {
picker.canSelectMany = this.args.multiselect!;
picker.matchOnDescription = true;
picker.matchOnDetail = true;
const config = vscode.workspace.getConfiguration("shellInput");
picker.ignoreFocusOut =
config.get<boolean>("ignoreFocusOut") || false;

if (this.args.description !== undefined) {
picker.placeholder = this.args.description;
Expand Down
3 changes: 3 additions & 0 deletions src/lib/VariableResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,13 @@ export class VariableResolver {
const promptId = `prompt/${taskId}_${match.index}`;
const prevValue = this.context.workspaceState.get<string>(promptId, '');
const initialValue = promptOptions.rememberPrevious ? prevValue : '';
const config = vscode.workspace.getConfiguration("shellInput");
const ignoreFocusOut = config.get<boolean>("ignoreFocusOut") || false;

const result = (await vscode.window.showInputBox({
value: initialValue,
prompt: promptOptions.prompt,
ignoreFocusOut,
})) ?? '';

this.context.workspaceState.update(promptId, result);
Expand Down