Skip to content

shell.openPath is blocking on Linux when it should be non-blocking #47668

@jking-realyze

Description

@jking-realyze

Preflight Checklist

Electron Version

37.2.0

What operating system(s) are you using?

Ubuntu, Other Linux

Operating System Version

Pop!_OS 22.04 LTS

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

shell.openPath should not be a blocking call.

Actual Behavior

On Linux shell.openPath is a blocking call.

Testcase Gist URL

No response

Additional Information

Here is the linux implementation of shell.openPath (shell/common/platform_util_linux.cc:349)

void OpenPath(const base::FilePath& full_path, OpenCallback callback) {
  // This is async, so we don't care about the return value.
  XDGOpen(full_path.DirName(), full_path.value(), true, std::move(callback));
}

The third argument to XDGOpen is true. That argument is named wait_for_exit and causes the call to XDGOpen to be synchronous when true. (XDGOpen is defined on line 276 of the same file.)

That true should be false.

Metadata

Metadata

Assignees

Type

Projects

Status

🛠️ Fixed for Next Release

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions