Skip to content

Surface xdg-open errors from the open shell helper#6198

Open
sridhar-3009 wants to merge 1 commit into
basecamp:masterfrom
sridhar-3009:fix/6056-xdg-open-stderr
Open

Surface xdg-open errors from the open shell helper#6198
sridhar-3009 wants to merge 1 commit into
basecamp:masterfrom
sridhar-3009:fix/6056-xdg-open-stderr

Conversation

@sridhar-3009

Copy link
Copy Markdown

Problem

The open() shell function silences both stdout and stderr from xdg-open:

open() (
  xdg-open "$@" >/dev/null 2>&1 &
)

When xdg-open fails (unknown MIME type, missing handler, bad path), the user
gets no output at all—the command just silently does nothing.

Reported in #6056.

Fix

Drop only the stderr redirection. The function remains non-blocking and keeps
stdout suppressed (avoids noise from handlers that write to it), but
xdg-open errors now reach the terminal:

 open() (
-  xdg-open "$@" >/dev/null 2>&1 &
+  xdg-open "$@" >/dev/null &
 )

One character change. The non-blocking / no-job-control-noise behavior from
#4366 is fully preserved.

The open() alias was discarding both stdout and stderr, so any failure
from xdg-open (unknown MIME type, missing handler, malformed path) was
silently swallowed. This made debugging impossible from the terminal.

Drop only the stderr redirection. Stdout is still suppressed (avoids
noise from handlers that produce it), the call remains non-blocking
(no job-control completion messages), and error output from xdg-open
now reaches the user's terminal.

Fixes basecamp#6056.
Copilot AI review requested due to automatic review settings July 9, 2026 19:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts Omarchy’s interactive Bash open() helper so xdg-open failure messages are no longer silently discarded, while preserving the existing non-blocking behavior and keeping stdout suppressed to avoid handler noise.

Changes:

  • Stop redirecting xdg-open stderr to /dev/null so errors are visible to the user.
  • Keep the subshell wrapper and background execution to avoid job-control completion noise.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants