mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 14:03:58 +00:00
Add termux support for fish_config.
This commit is contained in:
parent
0ef6a136e8
commit
5b2250883a
1 changed files with 7 additions and 0 deletions
|
@ -8,6 +8,7 @@ try:
|
|||
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
|
||||
|
@ -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)
|
||||
|
@ -1505,6 +1510,8 @@ if isMacOS10_12_5_OrLater():
|
|||
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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue