Skip to content

Commit

Permalink
Add termux support for fish_config.
Browse files Browse the repository at this point in the history
  • Loading branch information
Liorst4 committed Oct 25, 2019
1 parent 655f7c8 commit a1d85ef
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions share/tools/web_config/webconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
except ImportError:
from cgi import escape as escape_html
from distutils.version import LooseVersion
from distutils.spawn import find_executable
import glob
import multiprocessing.pool
import operator
Expand Down Expand Up @@ -49,6 +50,10 @@ def is_wsl():
return True
return False

def is_termux():
""" Return whether we are running under the Termux application for Android"""
return 'com.termux' in os.environ['PATH'] and find_executable('termux-open-url')


# Disable CLI web browsers
term = os.environ.pop("TERM", None)
Expand Down Expand Up @@ -1505,6 +1510,8 @@ def log_error(self, format, *args):
subprocess.check_call(["open", fileurl])
elif is_wsl():
subprocess.call(["cmd.exe", "/c", "start %s" % url])
elif is_termux():
subprocess.call(["termux-open-url", url])
else:
webbrowser.open(fileurl)

Expand Down

0 comments on commit a1d85ef

Please sign in to comment.