aboutsummaryrefslogtreecommitdiffhomepage
path: root/share
diff options
context:
space:
mode:
authorGravatar d10n <david@bitinvert.com>2013-11-19 14:42:05 -0500
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-11-26 00:41:09 -0800
commit168d25e7806a147027a38c4e3135594c52bb7c2b (patch)
treeeb28a38819e74dee4a9e2c3aa3e8cbdc9150b2fd /share
parent63a15e232bd598cbba6bfe2c1a5b16ba0d923235 (diff)
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.
Diffstat (limited to 'share')
-rwxr-xr-xshare/tools/web_config/webconfig.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/share/tools/web_config/webconfig.py b/share/tools/web_config/webconfig.py
index f735a026..88c1e042 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: