Do not open CLI browsers when using fish_config.

From the Python webbrowser documentation:
"If text-mode browsers are used, the calling process will block until the user exits the browser."

Running fish_config on an ssh server with no GUI browser will open a CLI browser which blocks and stops the server from handling requests.
Using multiprocess to run the server in the background lets CLI browsers access the page, but the page is unusable.

For now, disable CLI browsers and recommend opening the page in a graphical browser.
In the future, maybe write a CLI utility to change prompts and delete history items.
This commit is contained in:
d10n 2013-11-19 14:42:05 -05:00 committed by ridiculousfish
parent 63a15e232b
commit 168d25e780

View file

@ -15,9 +15,15 @@ else:
import http.server as SimpleHTTPServer import http.server as SimpleHTTPServer
import socketserver as SocketServer import socketserver as SocketServer
from urllib.parse import parse_qs from urllib.parse import parse_qs
# Disable CLI web browsers
term = os.environ.pop('TERM', None)
import webbrowser import webbrowser
if term:
os.environ['TERM'] = term
import subprocess import subprocess
import re, socket, os, sys, cgi, select, time, glob import re, socket, cgi, select, time, glob
try: try:
import json import json
except ImportError: except ImportError: