Skip to content

Conversation

@roblourens
Copy link
Member

For #149910

if (args.length > 0) {
const cmd = quote(args.shift()!);
const arg = args.shift()!;
const cmd = argsCanBeInterpretedByShell ? arg : quote(arg);
Copy link
Contributor

@weinand weinand Jul 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to consider to duplicate the argument processing into two branches of an if-statement controlled by the argsCanBeInterpretedByShell flag. Keeping the two cases apart makes them easier to understand than having one piece of code sprinkled with the argsCanBeInterpretedByShell flag (especially if we'll have to add more logic for future fixes...)

}
for (const a of args) {
command += (a === '<' || a === '>') ? a : quote(a);
command += (a === '<' || a === '>' || argsCanBeInterpretedByShell) ? a : quote(a);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here the logic is too simple - no need to separate the logic...

Copy link
Contributor

@weinand weinand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently the argsCanBeInterpretedByShell flag is not used for external terminals. We should create a (debt?) issue for investigating this...

@roblourens roblourens merged commit 60f09d6 into main Jul 20, 2022
@roblourens roblourens deleted the roblourens/issue149910 branch July 20, 2022 13:02
@github-actions github-actions bot locked and limited conversation to collaborators Sep 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants