mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-12 13:08:49 +00: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
1 changed files with 3 additions and 1 deletions
|
@ -17,7 +17,6 @@ import socket
|
||||||
import string
|
import string
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import webbrowser
|
|
||||||
|
|
||||||
FISH_BIN_PATH = False # will be set later
|
FISH_BIN_PATH = False # will be set later
|
||||||
IS_PY2 = sys.version_info[0] == 2
|
IS_PY2 = sys.version_info[0] == 2
|
||||||
|
@ -39,6 +38,9 @@ def isMacOS10_12_5_OrLater():
|
||||||
|
|
||||||
# Disable CLI web browsers
|
# Disable CLI web browsers
|
||||||
term = os.environ.pop('TERM', None)
|
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:
|
if term:
|
||||||
os.environ['TERM'] = term
|
os.environ['TERM'] = term
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue