Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#79744 - [code] Editor opens '/usr/lib/code/code.js' on every start
Attached to Project:
Arch Linux
Opened by Hanabishi (Hanabishi) - Wednesday, 20 September 2023, 17:10 GMT
Last edited by Massimiliano Torromeo (mtorromeo) - Thursday, 28 September 2023, 15:14 GMT
Opened by Hanabishi (Hanabishi) - Wednesday, 20 September 2023, 17:10 GMT
Last edited by Massimiliano Torromeo (mtorromeo) - Thursday, 28 September 2023, 15:14 GMT
|
DetailsDescription:
Code opens an editor with '/usr/lib/code/code.js' on every start if electron flags are present. Introduced by https://gitlab.archlinux.org/archlinux/packaging/packages/code/-/commit/08dca5a4bc70f6fd433a468d6121d4d944081d16 Command line looks like '/usr/lib/electron25/electron --ozone-platform-hint=auto --disable-gpu-sandbox /usr/lib/code/code.js'. Additional info: * package versions: code 1.82.2-2 electron25 25.6.0-1 Steps to reproduce: 1. Define some electron flags in ~/.config/electron25-flags.conf (e.g. '--ozone-platform-hint=auto') 2. Run 'code'. |
This task depends upon
Closed by Massimiliano Torromeo (mtorromeo)
Thursday, 28 September 2023, 15:14 GMT
Reason for closing: Fixed
Additional comments about closing: code-1.82.2-3
Thursday, 28 September 2023, 15:14 GMT
Reason for closing: Fixed
Additional comments about closing: code-1.82.2-3
I have to do a bit of debugging.
It removes the first argument, but 'process.argv' actually contains the full command line at this point, so '/usr/lib/code/code.js' is not the first argument and '/usr/lib/electron25/electron' is being removed instead.
Considering that the script last time updated 2 years ago, I think there is some behavior changes in newer electron versions. I am not sure why it opens the file sometimes and sometimes don't though. But '/usr/lib/code/code.js' is always present in the command line.
So I think it will be better to do:
If I revert the last commit https://gitlab.archlinux.org/archlinux/packaging/packages/code/-/commit/08dca5a4bc70f6fd433a468d6121d4d944081d16 code never opens code.js.
I tried with different number of electron flags and code flags, and it seems to be working fine here.
Give a try to code-1.82.2-3
I also noticed that the current script does not capture 'code.js' itself, only flags prior it. If this is not intended, you need to do 'findIndex(...) + 1' to remove it.