done icon indicating copy to clipboard operation
done copied to clipboard

Not doing anything on WSL 2 with burnt toast installed

Open noahgaertner opened this issue 4 years ago • 21 comments

When I run sleep 6 like in the readme.md, no burnt toast output is displayed. Burnt toast does work when the New-BurntToastNotification command is run in both PowerShell 5 (default windows) and PowerShell 7 (the new open source one), which means it isn't a executionpolicy issue.

noahgaertner avatar Jun 14 '20 00:06 noahgaertner

Does it still do nothing if you minimise the window while it's sleeping?

ammgws avatar Jun 14 '20 00:06 ammgws

Yes, it does. I'm using the new windows terminal, if that matters at all.

noahgaertner avatar Jun 14 '20 00:06 noahgaertner

I just also tested it in the ubuntu app and it also doesn't work, so it shouldn't be an emulator issue

noahgaertner avatar Jun 14 '20 00:06 noahgaertner

There were recent changes made regarding WSL, to rule those out perhaps try an older release such as https://github.com/franciscolourenco/done/releases/tag/1.14.5 and see if it still reproduces?

ammgws avatar Jun 14 '20 00:06 ammgws

I just tried the old version, it does the same thing.

noahgaertner avatar Jun 14 '20 00:06 noahgaertner

Is the issue perhaps that done needs to be running a custom command? I do not have one set at the moment.

noahgaertner avatar Jun 14 '20 00:06 noahgaertner

For troubleshooting you could try setting a custom command to see if it even tries to run it or not. I don't have access to WSL2 so can't try it myself. Can you see if it works on WSL1?

ammgws avatar Jun 14 '20 01:06 ammgws

Okay, so I just tried the normal command in WSL 1 by cloning a large git repo (sleep doesn't work in wsl 1 apparently) and it still did not work. I'll try a couple custom commands tomorrow morning.

noahgaertner avatar Jun 14 '20 03:06 noahgaertner

The issue for me was this chunk of code uname -a | string match --quiet --regex Microsoft on lines 57 and 204. Unlike WSL1, WSL2 comes bundled with a real linux kernel, here's the output of uname -a: Linux DESKTOP-RDMPIAF 4.19.104-microsoft-standard #1 SMP Wed Feb 19 06:37:35 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux. We could try matching both microsoft and Microsoft, but WSL2 can use custom kernels without microsoft included in the name.

archilkarchava avatar Aug 25 '20 09:08 archilkarchava

There's an active issue on the WSL issue tracker about detection but I can't find it at the moment.

ammgws avatar Aug 25 '20 09:08 ammgws

Does this improve detection for custom kernels? https://stackoverflow.com/a/43618657

franciscolourenco avatar Aug 25 '20 09:08 franciscolourenco

Here's fork with a quick fix https://github.com/archilkarchava/done, custom kernel detection is not supported.

archilkarchava avatar Aug 25 '20 09:08 archilkarchava

Found the thread: https://github.com/Microsoft/WSL/issues/423

ammgws avatar Aug 25 '20 09:08 ammgws

I did a simple fix for that in #88, but a better way may be to rely on WSL specific variables being set (for instance, WSLENV). I am not sure it will work for custom kernels though.

❯ env | rg WSL
WSLENV=WT_SESSION::WT_PROFILE_ID
WSL_DISTRO_NAME=Ubuntu-20.04
WSL_INTEROP=/run/WSL/25821_interop

eugene-babichenko avatar Sep 03 '20 20:09 eugene-babichenko

@noahgaertner can you check if this is fixed in v1.14.10?

franciscolourenco avatar Oct 10 '20 21:10 franciscolourenco

@noahgaertner ping

franciscolourenco avatar Jan 24 '21 22:01 franciscolourenco

@noahgaertner ping

My laptop is currently with {manufacturer} to get fixed, I'll take a look at this when I get it back.

noahgaertner avatar Jan 24 '21 23:01 noahgaertner

@noahgaertner

franciscolourenco avatar Apr 05 '21 16:04 franciscolourenco

@franciscolourenco i'm using ubuntu on wsl2 and nothing seems to happen to me too.

$ echo $__done_version
1.16.1

$ uname -a
Linux DESKTOP-XXX 4.19.128-microsoft-standard #1 SMP Tue Jun 23 12:58:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

launching __done_windows_notification test notif manually seems to be working fine.

I'll be happy to provide more info since this plugin was really part of my workflow on linux (and thanks btw!) 😁

Pitasi avatar Apr 20 '21 11:04 Pitasi

hah, I may have found my issue.

I have a X org server running (VcXsrv) so that I can use xorg apps in windows, and the problem seems to be here: https://github.com/franciscolourenco/done/blob/8fd2bc5c95a93b65452281459a167f1bbfb58990/conf.d/done.fish#L84-L85 that returns true.

Swapping this if with the windows one at https://github.com/franciscolourenco/done/blob/8fd2bc5c95a93b65452281459a167f1bbfb58990/conf.d/done.fish#L89 is sufficient, personally tested.

Pitasi avatar Apr 20 '21 12:04 Pitasi

WSL systems might have Linux desktop utililies like notify-send that come installed with other packages, but Linux systems should not (normally) contain 'microsoft' in their uname -a, so I think it might be preferrable to put WSL-specific checks before the others.

std4453 avatar Jan 25 '22 17:01 std4453