Skip to content
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

Fix example in OS.shell_open() method documentation and add a new one #101263

Merged
merged 1 commit into from
Jan 9, 2025

Conversation

mateuseap
Copy link
Contributor

@mateuseap mateuseap commented Jan 8, 2025

Closes #10367

What I Did:

  • Fixed an issue with string escaping in an example provided for the OS.shell_open() method documentation. Now the example is properly escaped to reflect valid Windows path syntax.
  • Added a new example of how to open a Windows path using the OS.shell_open() method with a different syntax from the first Windows path example.

Demonstrations:

  • Current Windows path example shown in the OS.shell_open() documentation displaying error:
    image
  • Corrected Windows path example showing no errors:
    image
    • Note: I've tested this GDScript, and it opens the folder as expected. I attached the script to a node and ran the scene, and it worked perfectly. If needed, I can provide a GIF.

@mateuseap mateuseap requested a review from a team as a code owner January 8, 2025 03:52
@mateuseap mateuseap requested a review from RedMser January 8, 2025 05:26
Copy link
Member

@bruvzg bruvzg left a comment

Choose a reason for hiding this comment

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

Note: shell_open on Windows will also work with /, so [code]OS.shell_open("C:/Users/name/Downloads")[/code] can be added as alternative example as well.

@bruvzg bruvzg added this to the 4.4 milestone Jan 8, 2025
@Mickeon
Copy link
Contributor

Mickeon commented Jan 8, 2025

I think we could just stick to using / but I have no strong opinion on it. Windows is the odd one out.

@Mickeon Mickeon added the cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release label Jan 8, 2025
…example

Corrected improper string escaping in the OS.shell_open() Windows path example. Backslashes are now properly escaped to prevent string parsing errors. Also, added a new alternative example of how to mount a Windows path with OS.shell_open().
@mateuseap mateuseap changed the title Fix example in OS.shell_open() method documentation Fix example in OS.shell_open() method documentation and add a new one Jan 8, 2025
@mateuseap
Copy link
Contributor Author

@bruvzg I've added a new example using / only, as you suggested!

@akien-mga akien-mga merged commit d164f05 into godotengine:master Jan 9, 2025
20 checks passed
@akien-mga
Copy link
Member

Thanks!

@mateuseap mateuseap deleted the fix/os_shell_open branch January 15, 2025 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4.3 OS.shell_open() docs typo
5 participants