From 168d25e7806a147027a38c4e3135594c52bb7c2b Mon Sep 17 00:00:00 2001 From: d10n Date: Tue, 19 Nov 2013 14:42:05 -0500 Subject: [PATCH] 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. --- share/tools/web_config/webconfig.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/share/tools/web_config/webconfig.py b/share/tools/web_config/webconfig.py index f735a0268..88c1e042b 100755 --- a/share/tools/web_config/webconfig.py +++ b/share/tools/web_config/webconfig.py @@ -15,9 +15,15 @@ else: import http.server as SimpleHTTPServer import socketserver as SocketServer from urllib.parse import parse_qs + +# Disable CLI web browsers +term = os.environ.pop('TERM', None) import webbrowser +if term: + os.environ['TERM'] = term + import subprocess -import re, socket, os, sys, cgi, select, time, glob +import re, socket, cgi, select, time, glob try: import json except ImportError: