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 f55462f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions share/tools/web_config/webconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,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 0 == os.system('which termux-open-url > /dev/null 2>&1')


# Disable CLI web browsers
term = os.environ.pop("TERM", None)
Expand Down Expand Up @@ -1505,6 +1509,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 f55462f

Please sign in to comment.