Repository navigation
fix: wrong escaping on xdg-open (linux) - #21936
Merged
Merged
Conversation
|
You can test this PR using the following package version. |
Collaborator
|
Contributor
Author
|
@cla-avalonia agree |
MrJul
pushed a commit
to MrJul/Avalonia
that referenced
this pull request
Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does the pull request do?
This PR resolves the issue described in #20230.
What is the current behavior?
(Based on what I encountered) An unnecessary
\is added before the#character, causing the attempt to open a directory containing#to fail.More detailed information can be found here: #20230 (comment)
What is the updated/expected behavior with this PR?
The URI (file path, URL, etc.) is passed directly as an argument to
xdg-open, allowing directories containing#to be opened successfully.How was the solution implemented (if it's not obvious)?
(This is likely quite straightforward, but for the sake of clarity:)
Just like the macOS implementation, the arguments are passed directly to
xdg-open(i.e., without any escaping).Furthermore, the reason I didn't use the fix described in the additional information for Issue #20230 is that writing the code in a format similar to that for macOS eliminates the need for additional functions and avoids calling /bin/sh, which is of unclear necessity.
Checklist
Breaking changes
None
Obsoletions / Deprecations
None
Fixed issues
Fixes #20230
The Japanese original text before machine translation
What does the pull request do?
#20230 の問題を解決するものです。
What is the current behavior?
(私が直面した範囲では)
#の前に不必要な\が追加され、#を含むディレクトリを開くことに失敗します。こちらのほうがより詳細な情報があると思います : #20230 (comment)
What is the updated/expected behavior with this PR?
そのまま xdg-open の引数に URI (ファイルパスや URLなど) が送られ、正常に
#を含むディレクトリを開くことが出来ること。How was the solution implemented (if it's not obvious)?
(かなり愚直でわかりやすいと思いますが一応)
macos 向けのコードのように、引数をそのまま(つまり一切のエスケープ無しで) xdg-open の引数に渡るようにしています。
また、Issue #20230 の方に追加情報にある修正方法を使用しなかった理由は、 macos 向けのコードのような形にしたほうが、追加の関数も必要無く、必要性の不明な /bin/sh を呼び出しを回避できるからです。