Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions interactive/sync_errors_windows.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
//go:build windows

package interactive
func isIgnorableSyncError(err error) bool {
if err == nil {
return false
}

import (
"errors"
"syscall"
)
// Direct match
if errors.Is(err, windowsErrorInvalidHandle) {
return true
}

// ERROR_INVALID_HANDLE from Win32 API (winerror.h).
const windowsErrorInvalidHandle syscall.Errno = 6
// Handle wrapped syscall errors
var errno syscall.Errno
if errors.As(err, &errno) {
return errno == windowsErrorInvalidHandle ||
errno == syscall.EINVAL ||
errno == syscall.ENOTSUP
}

func isIgnorableSyncError(err error) bool {
// Keep this list narrow and Windows-specific; unexpected sync errors should be surfaced.
// ERROR_INVALID_HANDLE is common when stdout/stderr are attached to non-syncable console handles.
return errors.Is(err, syscall.EINVAL) || errors.Is(err, syscall.ENOTSUP) || errors.Is(err, windowsErrorInvalidHandle)
return false
}
13 changes: 9 additions & 4 deletions internal/staticserve/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<script src="/static/vendor/preact-hooks.umd.js"></script>
<script src="/static/vendor/htm.umd.js"></script>
<script src="/static/preact-bootstrap.js"></script>

<!-- Markdown parser (vendored local copy) -->
<script src="/static/vendor/marked.min.js"></script>
</head>
Expand All @@ -35,7 +35,12 @@
</div>
</div>

<!-- Application entry point - fetches data from /api/review -->
<script type="module" src="/static/app.js"></script>
</body>
<script>
window.__DATA__ = {{.JSONData}};
</script>
<script type="application/json" id="initial-data">
{{.JSONData}}
</script>

<script type="module" src="/static/app.js"></script></body>
</html>