profanity icon indicating copy to clipboard operation
profanity copied to clipboard

Opening a URL or avatar freezes Profanity for as long as the opened executable is currently running

Open techmetx11 opened this issue 2 years ago • 3 comments

Expected Behavior

Being able to use profanity while the opened executable is running

Current Behavior

Profanity freezes until I kill the opened executable

Possible Solution

Replace g_spawn_sync with g_spawn_async in call_external

Steps to Reproduce (for bugs)

  1. Have /url open set to open a browser, for example like Firefox or Chromium
  2. Close any existing browsers
  3. Open a URL in profanity using /url open

Context

This is noticable, if for example, /url open opens a new browser

Environment

  • Artix Linux (OpenRC)
  • glib: 2.72.3
Profanity, version 0.13.0dev.feature/1158-vcard.2e84acce
Copyright (C) 2012 - 2019 James Booth <[email protected]>.
Copyright (C) 2019 - 2022 Michael Vetter <[email protected]>.
License GPLv3+: GNU GPL version 3 or later <https://www.gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Build information:
XMPP library: libstrophe
Desktop notification support: Enabled
OTR support: Enabled (libotr 4.1.1)
PGP support: Enabled (libgpgme 1.18.0)
OMEMO support: Enabled
C plugins: Enabled
Python plugins: Enabled (3.10.7)
GTK icons/clipboard: Enabled
GDK Pixbuf: Enabled

techmetx11 avatar Sep 25 '22 21:09 techmetx11

Doesn't happen to me and neither to @mdosch. Which executable did you set? So I can test with that one.

jubalh avatar Sep 26 '22 09:09 jubalh

Replace g_spawn_sync with g_spawn_async in call_external

But sounds like this would make sense anyways. Will you open a PR for this?

jubalh avatar Sep 26 '22 09:09 jubalh

Doesn't happen to me and neither to @mdosch. Which executable did you set? So I can test with that one.

firefox, but make sure that Firefox isn't running already, or else it will just open a new tab and quit Profanity should freeze until you close Firefox

Replace g_spawn_sync with g_spawn_async in call_external

But sounds like this would make sense anyways. Will you open a PR for this?

Sure

techmetx11 avatar Sep 26 '22 11:09 techmetx11

So to clarify: if people use xdg-open everything works fine. If they call their browser directly (ie via setting /executable urlopen set "chromium %u") we get this behaviour.

jubalh avatar Oct 07 '22 14:10 jubalh

So to clarify: if people use xdg-open everything works fine. If they call their browser directly (ie via setting /executable urlopen set "chromium %u") we get this behaviour.

xdg-open doesn't fork into the background when there's no browser currently open, Nor does calling the browser directly

techmetx11 avatar Oct 09 '22 17:10 techmetx11