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

Infinite xdg-open threads #4

Open
icaroperseo opened this issue Dec 15, 2016 · 4 comments
Open

Infinite xdg-open threads #4

icaroperseo opened this issue Dec 15, 2016 · 4 comments
Assignees

Comments

@icaroperseo
Copy link

Hi!

I am currently having the following issue: Every time I run :Mpreview infinite xdg-open threads begin to be generated regardless of whether the browser is running or not, filling the RAM memory and swap until the system collapses. The threads continue to be generated despite closing the browser and editor. Killing processes does not seem to help (continue to be generated).

See below for details:

  • S.O.: Manjaro Linux x86_64.
  • R.A.M. and swap: 8G
  • D.E.: KDE 5.
  • Browser: Brave 0.12.14
  • Editor: NeoVim 0.1.7
  • Node: 7.2.1
  • Plugin system: Plug

Both the operating system and the plug-in are up to date. So far I have not had any problems using xdg-open & Brave, so I have not tried to establish another browser as default. I hope I have been as specific as possible.

Best regards.

@mklabs mklabs self-assigned this Dec 15, 2016
@mklabs
Copy link
Member

mklabs commented Dec 15, 2016

Hi!

Thanks for the detailed explanation. This is related to the recent PR #3, @yousefamar did you run into similar issues with xdg-open ?

Unfortunately, I'm running osx and won't be able to test until this week end on a linux box.

@icaroperseo
Copy link
Author

Hi @mklabs! Thanks for answering.

Investigating a little I found that the problem is O.S./xdg-open related, context: https://superuser.com/questions/1007807/xdg-open-hogging-the-cpu-by-forking-itself-endlessly

I have solved the problem by setting the following variable in my ~/.bashrc file (with the path to the browser you want to use):

export BROWSER=/usr/bin/brave

Previously I had never presented this situation, so I could not determine exactly where is the root of the issue (maybe it's the combination xdg-open & Brave browser but very surely I'm speculating).

Regards.

@yousefamar
Copy link
Contributor

Hi @icaroperseo, that's weird indeed since I believe xdg-open is supposed to try opening by MIME type before resorting to BROWSER and that shouldn't be xdg-open by default unless something else is setting it.

Could you do me a favour and replace the line that loads this plugin in your init.vim with:

Plug 'yousefamar/mdown.vim', { 'branch': 'patch-1', 'do': 'npm install' }

then run

:PlugClean
:PlugInstall

and see if the issue still persists? This fork is identical to upstream, except that it opens the browser using node-open, which does exactly the same thing except it's bundled with it's own xdg-open script, meaning no external dependencies.

If it doesn't, and @mklabs is ok with it, then I'll make a PR to close this issue.

@mklabs
Copy link
Member

mklabs commented Jan 4, 2017

@yousefamar Thanks for the detailed explanation. I'd be happy to merge it if you do.

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

No branches or pull requests

3 participants