Skip to content

Windows: berth notify opens a visible console window at logon; closing it kills the tray #344

Closed

Description

@azrael-229

The Windows binary is built with the default console subsystem (Subsystem = 3), so berth notify — a pure tray/GUI program — always gets a console attached. service install --notify writes the bare exe to HKCU\...\Run, so at logon a visible terminal window opens, and because the process is bound to that console, closing the window sends CTRL_CLOSE_EVENT and the tray exits.

Repro (Windows 11 24H2, berth 0.6.0): service install --notify, reboot → terminal window with the notify log line; close window → tray icon disappears.

Suggested fix: on Windows, have service install --notify write a hidden launcher (e.g. the same VBS-stub pattern the daemon/gateway/harbor units use, SW_HIDE + log-to-file) instead of the bare exe. A separate -H windowsgui build for notify is also possible but would require a second binary (the shared CLI needs console stdio).

Workaround until fixed: point the BerthNotify Run value at a VBS stub that runs cmd.exe /c """<exe>"" notify >> <log> 2>&1", 0, True.

Activity

  1. T-Crypt commented on Nov 16, 2026

    @T-Crypt
    Owner

    Fixed in #349, which is on main and next. service install --notify now writes units\berth-notify.vbs and sets the Run value to wscript.exe //B //Nologo "<that stub>". That is the launcher pattern you suggested and the one the other services use. The tray's output goes to logs\berth-notify.log. Run service install --notify again to replace the old Run value. service uninstall removes the stub with the Run value.

    I could only test this under wine. If you can, please confirm on 24H2 that no window opens at logon.

  2. azrael-229 commented on Nov 16, 2026

    @azrael-229
    Author

    Tested already and no window anymore. As always, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions