microsoft / wslg

Enabling the Windows Subsystem for Linux to include support for Wayland and X server related scenarios
MIT License
10.07k stars 304 forks source link

Launching some apps (Sublime Text/Merge) from Start menu does not work #279

Open u1f408 opened 3 years ago

u1f408 commented 3 years ago

Environment

Windows build number: 10.0.21390.0
Your Distribution version: Fedora Remix 34
Your WSLg version: 1.0.22

Steps to reproduce

WSL logs:

pulseaudio.log, weston.log, and versions.txt in a Gist

A mesa version is missing from versions.txt here, not sure whether that's significant?

Expected behavior

Clicking on a Linux GUI app in the Start menu will start the application.

Actual behavior

Application does not start. Launching the application from a terminal, however, does work.

Here's a screencast of this, in case it's useful.

hideyukn88 commented 3 years ago

@u1f408, thanks for reporting the issue, may I clarify that any app doesn't work from Start Menu? or only specific application you have captured in the screenshot? sublime_merge doesn't start up? thanks!

u1f408 commented 3 years ago

may I clarify that any app doesn't work from Start Menu? or only specific application you have captured in the screenshot?

@hideyukn88 I just tested this with XTerm and Alacritty and both of those work, so it seems like it's not all apps - but Sublime Text and Sublime Merge are both affected.

echuber2 commented 3 years ago

Is the launch shortcut a shell script that makes certain assumptions? I know subl is usually set up as a script.

u1f408 commented 3 years ago

I know subl is usually set up as a script.

/opt/sublime_merge/sublime_merge (and /opt/sublime_text/sublime_text) are actual binaries, not shell scripts:

❯ file /opt/sublime_text/sublime_text
/opt/sublime_text/sublime_text: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, stripped

The WSLg-generated Start Menu shortcuts try to launch those binaries and fails, and when I manually run the same command used by the shortcut (incl. command-line options) in a terminal, the application starts.

JustLookAtNow commented 3 years ago

I have the same question

rockerest commented 2 years ago

I would be happy to make modifications to either the .desktop file in Ubuntu or to the Windows shortcut to make this work (or other modifications I'm not imagining).

Is there any work around?


I have tried switching /opt/sublime_text/sublime_text to simply be subl. No effect.

pclemins commented 2 years ago

Came here to report the same issue... and tried adjusting the windows shortcut like @rockerest, but no luck. Running:

Windows 11: 22000.527 Distribution: Ubuntu 18.04 wsl Kernel version: 5.10.60.1

Interested in fix and willing to help!

kistlin commented 1 year ago

Hello,

this was bothering me too. After some trial and error that's what worked for me.

Change the shortcuts to (check your Ubuntu version)

Sublime Text

C:\Users\<user>\AppData\Local\Microsoft\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForLinux_<hash>\wslg.exe -d Ubuntu-22.04 --cd "~" -- /opt/sublime_text/sublime_text  --detached

(add --detached)

Sublime Merge

C:\Users\<user>\AppData\Local\Microsoft\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForLinux_<hash>\wslg.exe -d Ubuntu-22.04 --cd "~" -- /opt/sublime_merge/sublime_merge  --multiinstance

(add --multiinstance)

How to find out? Execute the application from the command line within WSL2 (ex. subl) and check what command line arguments were used with ps aux. Add them to the shortcut and see what is necessary.

After this change my applications start up.

lizsugar commented 1 year ago

(add --multiinstance)

Thank you!! Sublime Merge Linux is launching perfectly from my start menu now.