mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00:00
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:
parent
63a15e232b
commit
168d25e780
1 changed files with 7 additions and 1 deletions
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue