mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 06:41:42 +08:00
webconfig: import webbrowser with empty TERM
Re-introduces the changes from168d25e780
which were inadvertently removed in20bcbcc252
. Work on #4299. Re-commit of #1132.
This commit is contained in:
parent
5c56765d12
commit
61ab3aea8c
|
@ -17,7 +17,6 @@ import socket
|
|||
import string
|
||||
import subprocess
|
||||
import sys
|
||||
import webbrowser
|
||||
|
||||
FISH_BIN_PATH = False # will be set later
|
||||
IS_PY2 = sys.version_info[0] == 2
|
||||
|
@ -39,6 +38,9 @@ def isMacOS10_12_5_OrLater():
|
|||
|
||||
# Disable CLI web browsers
|
||||
term = os.environ.pop('TERM', None)
|
||||
# This import must be done with an empty $TERM, otherwise a command-line browser may be started
|
||||
# which will block the whole process - see https://docs.python.org/3/library/webbrowser.html
|
||||
import webbrowser
|
||||
if term:
|
||||
os.environ['TERM'] = term
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user