Repository navigation
fix(desktop): show console output of deno desktop --hmr apps on Windows - #37123
Open
Aschenbath wants to merge 1 commit into
Open
Aschenbath wants to merge 1 commit into
Aschenbath wants to merge 1 commit into
Conversation
…dows Closes denoland#36501 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NetOpWibby
pushed a commit
to theende/ende
that referenced
this pull request
Nov 7, 2026
…dows Closes denoland/deno#36501 Ende changes: the dev-mode check reads `ENDE_DESKTOP_HMR`, and the call sits at the top of `runtime_main` (Ende's `laufey_runtime_start` body) instead of a `laufey::main!` closure. (cherry picked from commit 9e35c47cf3081ea89d80d0bd6bfc96b2698c2500) Upstream: denoland/deno#37123
|
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #36501
On Windows,
console.logandconsole.errorfrom adeno desktop --hmrapp never reached the terminal.The laufey backend (
laufey_webview.exe) is a GUI-subsystem executable. Whendeno desktop --hmrstarts it from a console, Windows gives it no console and no standard handles:GetStdHandle(STD_OUTPUT_HANDLE)andGetStdHandle(STD_ERROR_HANDLE)both return null in the backend, so everything the runtime writes is dropped. Whendeno's output is redirected to a file or pipe, the handles are passed explicitly and the output shows up, which is why this only happens in a real console.At startup,
rt_desktopnow checks whetherDENO_DESKTOP_HMRis set and the process has no console. If so, it attaches to the parent's console (AttachConsole(ATTACH_PARENT_PROCESS)), and points stdout and stderr atCONOUT$where they're still null. Handles the parent passed explicitly, such as a pipe or a file, are kept.DENO_DESKTOP_HMRis only set for development runs, so an app started normally, e.g. from Explorer, still runs without a console.Testing
Windows 11,
main.tscontainingconsole.log("hello-from-desktop"); console.error("err-from-desktop");,deno desktop --hmr main.tswith the webview backend:deno+denort.dllbuilt locally)To read the real console, I started
denoin a new console window (CREATE_NEW_CONSOLE), attached to that console and read its screen buffer. A temporary diagnostic in this function confirmed that both standard handles are null in the backend before this change.cargo clippy -p denort_desktop -- -D warnings,cargo fmt --checkand dprint are clean.Not covered: stdin is left as it was, and I haven't checked the CEF backend.
AI disclosure
This PR was written primarily by Claude Code (Claude Opus 5.5), including the change, the investigation and this description.
🤖 Generated with Claude Code