-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
issue with the last release: cmd "flash" each time SF query is done #2833
Comments
Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support. |
Hello @THLG-MGP 👋 It looks like you didn't include the full Salesforce CLI version information in your issue. A few more things to check:
Thank you! |
I'd be very interested in where solves your problem. |
sf version --verbose --json I will wrote a powershell sample script to reproduce the issue In the main time, how can I downgrade ? Thanks. |
Powershell code to reproduce the issue (cmd prompt will flashed)
|
the previous comment has a link to our docs telling you how to do that |
This issue has been linked to a new work item: W-15576746 |
This is definitely related to a security change that node forced (see #2822 for details). It somehow doesn't seem to affect all windows users. I'm still trying to replicate it and find out what situations it could be happening in. If you've got more information or a reliable repro, please pile on! |
Hi |
Hi |
@mshanemc I can repro on Windows 11 Pro using standard command window (not Power Shell) I'm game to let you look over my shoulder if you need to troubleshoot via screenshare |
Here's a pair of files that demonstrate the issue with spawning a detached shell process:
wait.js
On my machine, Node v20.11.0, Windows 10 Enterprise 22H2 19045.4170, running |
Retested my example in v20.12.2, same behavior. Running spawn() with shell:true and detached:true opens a new window. The original fix for #2822 was due to the Node fix for CVE-2024-27980. This CVE noted that calling Win32 CreateProcess() with a .BAT or .CMD file could result in a vulnerability in program arguments. The Node fix was to disallow calling spawn() on a BAT or CMD file unless shell:true was set. When shell:true is set, spawn() will actually run 'cmd.exe /d /s /c "[batchfile] [arguments]"', which will process the arguments correctly. Issue #2822 needed to be fixed because the post-install script ran a command file "run.cmd". However, there was a further PR to plugin-telemetry ( salesforcecli/plugin-telemetry#611 ) that added shell:true to a detached spawn() call. This call actually spawns "node.exe" (process.argv[0]), which is not a BAT or CMD file. The shell:true option should not be necessary. |
This issue is fixed in the 2.42.6 (May 22, 2024) release. |
Hi
I just updated Salesforce CLI, and since, each time my script execute a sf command, a "cmd" windows is "flashing" and prevents me from working (app lost focus because the cmd get the focus).
Salesforce CLI version: @salesforce/cli/2.38.6 win32-x64 node-v20.12.1
I tried to screenshot this issue.
It prevents me to work if my powershell script is running.
1/ Can you fix it ?
2/ How can I go back to the previous release as a workarround?
Thanks.
The text was updated successfully, but these errors were encountered: