Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
techmetx11 opened this issue Sep 25, 2022 · 5 comments · Fixed by #1760
Assignees
Milestone

Comments

@techmetx11
Copy link
Contributor

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 <boothj5web@gmail.com>.
Copyright (C) 2019 - 2022 Michael Vetter <jubalh@iodoru.org>.
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
@jubalh
Copy link
Member

jubalh commented Sep 26, 2022

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

@jubalh
Copy link
Member

jubalh commented Sep 26, 2022

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 jubalh added this to the next milestone Sep 26, 2022
@techmetx11
Copy link
Contributor Author

techmetx11 commented Sep 26, 2022

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

@jubalh
Copy link
Member

jubalh commented Oct 7, 2022

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.

@techmetx11
Copy link
Contributor Author

techmetx11 commented Oct 9, 2022

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

jubalh pushed a commit to techmetx11/profanity that referenced this issue Oct 12, 2022
jubalh pushed a commit to techmetx11/profanity that referenced this issue Oct 12, 2022
Drawback is that we can't check the exitcode anymore.
But we were unsure why/when we need this, see:
https://github.com/profanity-im/profanity/pull/1760/files#r980868708

Fixes profanity-im#1759
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants