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

Executing Shortcut doesn't produce any visible output #141

Closed
artman41 opened this issue Aug 21, 2020 · 9 comments · Fixed by #145
Closed

Executing Shortcut doesn't produce any visible output #141

artman41 opened this issue Aug 21, 2020 · 9 comments · Fixed by #145
Labels
Bug This is either an issue that describes a bug or a PR that resolves a bug Status: Pending Release This is fixed but not yet released. Target: LTS This is targeted to the LTS release. Target: 3.x This is targeted to the 3.x version.

Comments

@artman41
Copy link

artman41 commented Aug 21, 2020

Background Information:

  • Build: 19041
  • WSL: Fedora 31 (Custom Built)
[artman41@DESKTOP-TQGCI07 bin ]$ cat /etc/redhat-release
Fedora release 31 (Thirty One)
[artman41@DESKTOP-TQGCI07 bin ]$ rpm -q kernel
kernel-5.6.8-200.fc31.x86_64
kernel-5.7.9-100.fc31.x86_64
kernel-5.7.15-100.fc31.x86_64
[artman41@DESKTOP-TQGCI07 bin ]$ uname -r
4.19.84-microsoft-standard  
  • Version: 3.2.0
[artman41@DESKTOP-TQGCI07 bin ]$ yum list installed | grep wslu
wslu.noarch                                  3.2.0-1                             @copr:copr.fedorainfracloud.org:wslutilities:wslu   

Describe the bug
Executing the created Shortcut shows the Windows Hourglass cursor for a brief second before returning to the default Cursor. No other actions happen.

To Reproduce
Steps to reproduce the behavior:

  • Create Shortcut
[artman41@DESKTOP-TQGCI07 bin ]$ wslusc -i `pwd`/idea.png -g `pwd`/idea.sh
[info] You choose to use custom icon: /home/artman41/idea/current/bin/idea.png. Processing...
[info] Converting png icon to ico...
[info] Create shortcut idea.sh.lnk successful    

image

  • Execute Shortcut

Expected behavior
Application to load via X11 similar to a native app

Additional context

  • This was tested in response to WSL Path is incorrect with Custom built Distro #138 being fixed in v3.2.0 (Environment has not changed since raising the issue)
  • Executing idea.sh from the terminal loads the GUI as expected, whereas the shortcut doesn't have any visible effect
  • Other applications such as gedit load when ran from the terminal but not when executed via shortcut

The 'target' of the shortcut is as follows

C:\Windows\System32\wscript.exe C:\\Users\\Tyler\wslu\runHidden.vbs C:\\\\\\Windows\\System32\\wsl.exe -d fedora -d fedora -e  /usr/share/wslu/wslusc-helper.sh "/home/artman41/idea/idea-IC-202.6397.94/bin/idea.sh "
@gerardvt
Copy link

Same issue here.

Further testing shows that the bug is due to the wsluc-helper.sh script setting the wrong value for the DISPLAY environment variable.

On the test system, the correct value for DISPLAY (resulting in 172.22.112.1:0.0 in my case) is obtained by:
wsl2_d_tmp="$(grep nameserver /etc/resolv.conf | awk '{print $2}')"
export DISPLAY=${wsl2_d_tmp}:0

However the script erroneously sets the DISPLAY (resulting in 192.168.43.50:0.0 in my case) value by using the lines in the script:
set +H
wsl2_d_tmp="$(eval "$ipconfig_exec" | grep -n -m 1 "Default Gateway.*: [0-9a-z]" | cut -d : -f 1)"
wsl2_d_tmp="$(eval "$ipconfig_exec" | sed $(( wsl2_d_tmp - 4 ))','$(( wsl2_d_tmp + 0 ))'!d' | grep IPv4 | cut -d : -f 2 | sed -e "s|\s||g" -e "s|\r||g")"
set -H
export DISPLAY=${wsl2_d_tmp}:0.0

A quick hack to get the script to work is to cut and paste the following two lines just before the last 2 lines in the script (i.e. lines "cd ~ || exit" and "bash -l -c "$*"):
wsl2_d_tmp="$(grep nameserver /etc/resolv.conf | awk '{print $2}')"
export DISPLAY=${wsl2_d_tmp}:0

@gerardvt
Copy link

Did not pursue further debugging to test why wrong path in script is being selected in setting the DISPLAY env var.

@patrick330602
Copy link
Member

Hi @artman41 ,
Can you try to remove ~/.config/wslu folder? I will try to make a quick patch.

Hi @gerardvt ,
what system language you are using? Thanks

@gerardvt
Copy link

Just referring to wsluc-helper.sh bash script installed as part of wslutilities on ubuntu 20.04 wsl 2

@patrick330602
Copy link
Member

@gerardvt Just to confirm, do you install the PPA version or the version that in the main?

@patrick330602 patrick330602 added Bug This is either an issue that describes a bug or a PR that resolves a bug Status: In Progress This is being worked on and not ready. Target: 3.x This is targeted to the 3.x version. Target: LTS This is targeted to the LTS release. labels Aug 30, 2020
@gerardvt
Copy link

Sorry I was not clear. I installed wslu via apt on ubuntu 20.04. Version details below.

$> apt-cache policy wslu
wslu:
Installed: 3.1.1-1
Candidate: 3.1.1-1
Version table:
*** 3.1.1-1 500
500 https://access.patrickwu.space/wslu/debian buster/main amd64 Packages
100 /var/lib/dpkg/status
2.3.6-0ubuntu2~20.04.0 500
500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
2.3.6-0ubuntu1 500
500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages

@patrick330602 patrick330602 added Status: Pending Release This is fixed but not yet released. and removed Status: In Progress This is being worked on and not ready. labels Sep 8, 2020
@patrick330602
Copy link
Member

patrick330602 commented Sep 8, 2020

@artman41 I have fixed and the fix will be available for 3.2.1
@gerardvt Please use the Ubuntu official PPA instead of the Debian one for the latest release: https://launchpad.net/~wslutilities/+archive/ubuntu/wslu

@romanlex
Copy link

@patrick330602 when are you planning to release 3.2.1? 😊

@patrick330602
Copy link
Member

@romanlex There is a blocking bug I am currently fixing, hopefully it will be fixed today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is either an issue that describes a bug or a PR that resolves a bug Status: Pending Release This is fixed but not yet released. Target: LTS This is targeted to the LTS release. Target: 3.x This is targeted to the 3.x version.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants