Skip to content
Closed
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
13 changes: 12 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,18 @@
"command": "shellCommand.execute",
"title": "Execute shell command"
}
]
],
"configuration": {
"title": "Tasks Shell Input",
"type": "object",
"properties": {
"shellCommand.ignoreFocusOut": {
"type": "boolean",
"default": "true",
"description": "keep input boxes open when focus moves to another part of the editor"
}
}
}
},
"scripts": {
"vscode:prepublish": "npm run compile",
Expand Down
3 changes: 2 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ 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 ignoreFocusOut = vscode.workspace.getConfiguration('shellCommand').get<boolean>('ignoreFocusOut');
const inputValue = await vscode.window.showInputBox({ ignoreFocusOut });

return inputValue || '';
};
Expand Down
2 changes: 2 additions & 0 deletions src/lib/VariableResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,11 @@ export class VariableResolver {
const prevValue = this.context.workspaceState.get<string>(promptId, '');
const initialValue = promptOptions.rememberPrevious ? prevValue : '';

const ignoreFocusOut = vscode.workspace.getConfiguration('shellCommand').get<boolean>('ignoreFocusOut');
const result = (await vscode.window.showInputBox({
value: initialValue,
prompt: promptOptions.prompt,
ignoreFocusOut,
})) ?? '';

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