Open noahgaertner opened 4 years ago
Does it still do nothing if you minimise the window while it's sleeping?
Yes, it does. I'm using the new windows terminal, if that matters at all.
I just also tested it in the ubuntu app and it also doesn't work, so it shouldn't be an emulator issue
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?
I just tried the old version, it does the same thing.
Is the issue perhaps that done needs to be running a custom command? I do not have one set at the moment.
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?
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.
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.
There's an active issue on the WSL issue tracker about detection but I can't find it at the moment.
Does this improve detection for custom kernels? https://stackoverflow.com/a/43618657
Here's fork with a quick fix https://github.com/archilkarchava/done, custom kernel detection is not supported.
Found the thread: https://github.com/Microsoft/WSL/issues/423
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
@noahgaertner can you check if this is fixed in v1.14.10?
@noahgaertner ping
@noahgaertner ping
My laptop is currently with {manufacturer} to get fixed, I'll take a look at this when I get it back.
@noahgaertner
@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!) 😁
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.
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.
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.