From 4bf59393ecb1317f1494d945883240c0c2a94d04 Mon Sep 17 00:00:00 2001 From: tims <0xtimsb@gmail.com> Date: Sat, 30 Nov 2024 02:29:04 +0530 Subject: [PATCH] linux: Fix Zed not visible in "Open With" list in file manager for Flatpak (#21177) - Closes #19030 When `%U` is used in desktop entries, file managers pick this and use it: - When you right-click a file and choose "Open with..." - When you drag and drop files onto an application icon image Adding it to CLI args, changes Flatpak desktop entry `Exec` from: ```diff - Exec=/usr/bin/flatpak run --branch=master --arch=x86_64 --command=zed dev.zed.ZedDev --foreground + Exec=/usr/bin/flatpak run --branch=master --arch=x86_64 --command=zed --file-forwarding dev.zed.ZedDev --foreground @@u %U @@ ``` This is Flatpak's way of doing `%U`, by adding `--file-forwarding` and wrapping arg with `@@u` and `@@`. Read more below ([source](https://docs.flatpak.org/en/latest/flatpak-command-reference.html)): > --file-forwarding > > If this option is specified, the remaining arguments are scanned, and all arguments that are enclosed between a pair of '@@' arguments are interpreted as file paths, exported in the document store, and passed to the command in the form of the resulting document path. Arguments between "@@u" and "@@" are considered URIs, and any "file:" URIs are exported. The exports are non-persistent and with read and write permissions for the application. Release Notes: - Fixed Zed not visible in the "Open with" list in the file manager for Flatpak. --- crates/zed/resources/flatpak/manifest-template.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/zed/resources/flatpak/manifest-template.json b/crates/zed/resources/flatpak/manifest-template.json index 7905058f44..1560027e9f 100644 --- a/crates/zed/resources/flatpak/manifest-template.json +++ b/crates/zed/resources/flatpak/manifest-template.json @@ -32,7 +32,7 @@ "BRANDING_LIGHT": "$BRANDING_LIGHT", "BRANDING_DARK": "$BRANDING_DARK", "APP_CLI": "zed", - "APP_ARGS": "--foreground", + "APP_ARGS": "--foreground %U", "DO_STARTUP_NOTIFY": "false" } },