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

The windows.toast_notification() function is not working properly. #5166

Open
leetking opened this issue Mar 15, 2024 · 7 comments
Open

The windows.toast_notification() function is not working properly. #5166

leetking opened this issue Mar 15, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@leetking
Copy link

What Operating System(s) are you seeing this problem on?

Windows

Which Wayland compositor or X11 Window manager(s) are you using?

winver: 19045.3803

WezTerm version

wezterm 20240203-110809-5046fc22

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

I started the Lua debugging layer using Ctrl+Shift+L, and then I entered

> win = wezterm.gui.gui_windows()[1]
> print(win)
13:50:49.642 INFO logging > lua: GuiWin(mux_window_id:0, pid:4532)
> win:toast_notification('wezterm', 'hello world!', nil, 4000)

but no toast notification is being displayed.

To Reproduce

No response

Configuration

return {}

Expected Behavior

I would like to see a notification message in the status bar.

Logs

Debug Overlay
wezterm version: 20240203-110809-5046fc22 x86_64-pc-windows-msvc
Window Environment: Windows
Lua Version: Lua 5.4
OpenGL: Intel(R) UHD Graphics 630 4.5.0 - Build 31.0.101.2115
Enter lua statements or expressions and hit Enter.
Press ESC or CTRL-D to exit

win = wezterm.gui.gui_windows()[1]
print(win)
13:50:49.642 INFO logging > lua: GuiWin(mux_window_id:0, pid:4532)
win:toast_notification('wezterm', 'hello world!', nil, 4000)

Anything else?

I installed WezTerm using Scoop.

@leetking leetking added the bug Something isn't working label Mar 15, 2024
@mrjones2014
Copy link
Contributor

Same here, window:toast_notification doesn't seem to do anything for me?

@seapat
Copy link

seapat commented May 27, 2024

I think this has something to do with the installation method.

On Windows, notifications work when installed with winget (i.e. using the installer as non-portable), while with scoop (as a portable install) not notifications show. I tested this the same way as @leetking, can someone else confirm this?

@Ryex
Copy link

Ryex commented May 27, 2024

I too use scoop and toast notifications do not work. I'll try installing the non portable version and testing.
EDIT: toasts work when using wezterm installed via the setup.exe

@leetking
Copy link
Author

I did some tests as follows:

  1. The wezterm installed by scoop actually downloads the non-portable installation package from the release page https://github.com/wez/wezterm/releases/download/20240203-110809-5046fc22/WezTerm-windows-20240203-110809-5046fc22.zip , so after I manually downloaded the portable zip, decompressed it and used it, I found that notification could not be triggered either.
  2. After downloading setup.exe and installing it, click on the newly installed wezterm-gui.exe. The experiment found that notification can be triggered.
  3. Interestingly, I also opened wezterm-gui.exe installed by scoop and found that nofication can also be triggered.
  4. Uninstall the wezterm installed through setup.exe and reopen the wezterm installed by scoop. Nofication cannot be triggered.

Presumption: The setup.exe installation will register some information in the system, but the scoop or downloaded portable version lacks this information, resulting in the failure to trigger the notification.

@seapat
Copy link

seapat commented May 28, 2024

  1. The wezterm installed by scoop actually downloads the non-portable installation package from the release page ...

Scoop packages usually extract the contents .exe, so the bundled installer is not run. From looking at the manifest, this seems to be the case. Although I do not really know any technical details on what that means.

  1. Interestingly, I also opened wezterm-gui.exe installed by scoop and found that nofication can also be triggered.

I can confirm this, probably because the installer does something® that makes the notification possible irrespective of the installation path.

The setup.exe installation will register some information in the system, but the scoop or downloaded portable version lacks this information, resulting in the failure to trigger the notification.

My first guess would be a registry key, scoop does not automatically edit the registry by default.

@leetking
Copy link
Author

https://learn.microsoft.com/en-us/answers/questions/159295/no-desktop-notifications-for-portable-apps-from-ne
According to this article, it seems to be a common problem with portable programs.
According to the answer of Eleven Yu:

The notifications settings can be deployed by GPO or registry.
Group Policy:
Computer Configuration\Administrative Templates\Windows Components\App Privacy - Let Windows apps access notifications
Registry:
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\AppPrivacy

I need to register a GPO, but I don’t know much about it.

@leetking
Copy link
Author

According to my understanding: Wezterm's setup.exe is generated by inno setup. After it is installed, it appears as an application on the Windows system. The installed program can be found in Notifications & actions, so you can control whether notifications are allowed to be issued. , but the portable program does not appear as an application to windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants