beeps on Linux are made by writing BEL to /dev/console,
which requires elevated permissions on Ubuntu. So if
opening /dev/console fails, fall back to /dev/tty.
Allows passing `workingDirectory` to the underlying `ShellExecuteW` API on Windows.
the motivation is that by default `ShellExecute` would use the current working directory, which would get locked on Windows and can prevent autoUpdater from working correctly. We need to be able specify a different `workingDirectory` to prevent this situation.
Waiting for xdg-open to return freezes Electron application.
Some file managers (ex: Nemo) don't return until some time after they are closed, this freezes the Electron application until the process returns.
The same is true about any application that can potentially be opened with OpenItem
Ideally this will become the default as `gvfs-trash` is deprecated and nothing more than a wrapper to `gio`
but at least allow easily opting into the modern method.
If ELECTRON_TRASH is null, first check the DESKTOP_SESSION variable and set trash accordingly. Additional desktop environments can be added easily this way with the fallback of ELECTRON_DEFAULT_TRASH.
Some browsers (eg. Firefox) may not return until the browser window is
closed. This causes the Electron application to lock up while the browser
window is open.
See https://github.com/atom/atom/issues/6320