browsh-org / browsh

A fully-modern text-based browser, rendering to TTY and browsers
https://www.brow.sh
GNU Lesser General Public License v2.1
17.02k stars 415 forks source link

Unclear behavior of background Firefox process when quitting Browsh #455

Open 64kramsystem opened 1 year ago

64kramsystem commented 1 year ago

When Browsh exits (via Ctrl+q), the Firefox processes keep running in the background (described here).

However, when I try to connect back to Firefox (browsh --firefox.use-existing), Browsh can't connect:

Failed to connect to Firefox's Marionette within 30 seconds

This is odd, because Firefox is running in the background, seemingly with the proper options:

/usr/lib/firefox/firefox --marionette --headless --profile /home/myuser/.config/browsh/firefox_profile
 \_ /usr/lib/firefox/firefox -contentproc -parentBuildID 20221208122842 -prefsLen 25277 -prefMapSize 227396 -appDir /usr/lib/firefox/browser {c5b96a9e-bad9-43c0-8c5f-f89890ae2dab} 1
 \_ /usr/lib/firefox/firefox -contentproc -childID 1 -isForBrowser -prefsLen 25418 -prefMapSize 227396 -jsInitLen 246772 -parentBuildID 20221208122842 -appDir /usr/lib/firefox/brows
 \_ /usr/lib/firefox/firefox -contentproc -childID 2 -isForBrowser -prefsLen 30692 -prefMapSize 227396 -jsInitLen 246772 -parentBuildID 20221208122842 -appDir /usr/lib/firefox/brows
 \_ /usr/lib/firefox/firefox -contentproc -childID 7 -isForBrowser -prefsLen 30692 -prefMapSize 227396 -jsInitLen 246772 -parentBuildID 20221208122842 -appDir /usr/lib/firefox/brows
 \_ /usr/lib/firefox/firefox -contentproc -childID 8 -isForBrowser -prefsLen 30692 -prefMapSize 227396 -jsInitLen 246772 -parentBuildID 20221208122842 -appDir /usr/lib/firefox/brows
 \_ /usr/lib/firefox/firefox -contentproc -parentBuildID 20221208122842 -prefsLen 30692 -prefMapSize 227396 -appDir /usr/lib/firefox/browser {e9fed409-97cb-4204-9427-b210956d8690} 1
 \_ /usr/lib/firefox/firefox -contentproc -parentBuildID 20221208122842 -sandboxingKind 0 -prefsLen 30692 -prefMapSize 227396 -appDir /usr/lib/firefox/browser {3fc6b70f-889d-4d1a-ae
 \_ /usr/lib/firefox/firefox -contentproc -childID 9 -isForBrowser -prefsLen 30692 -prefMapSize 227396 -jsInitLen 246772 -parentBuildID 20221208122842 -appDir /usr/lib/firefox/brows
 \_ /usr/lib/firefox/firefox -contentproc -childID 10 -isForBrowser -prefsLen 30692 -prefMapSize 227396 -jsInitLen 246772 -parentBuildID 20221208122842 -appDir /usr/lib/firefox/brow
 \_ /usr/lib/firefox/firefox -contentproc -childID 20 -isForBrowser -prefsLen 30701 -prefMapSize 227396 -jsInitLen 246772 -parentBuildID 20221208122842 -appDir /usr/lib/firefox/brow
 \_ /usr/lib/firefox/firefox -contentproc -childID 21 -isForBrowser -prefsLen 30701 -prefMapSize 227396 -jsInitLen 246772 -parentBuildID 20221208122842 -appDir /usr/lib/firefox/brow
 \_ /usr/lib/firefox/firefox -contentproc -childID 22 -isForBrowser -prefsLen 30701 -prefMapSize 227396 -jsInitLen 246772 -parentBuildID 20221208122842 -appDir /usr/lib/firefox/brow

I've left the issue title generic, because this problem could be interepreted in at least two ways:

  1. the processes should be killed on exit (in this case, this is a duplicate of #312)
  2. browsh should be able to connect to the running processes
tombh commented 1 year ago

I think you might have found the source of an often reported bug!