Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions open.tmux
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ is_cygwin() {
[[ "$(uname)" =~ CYGWIN ]]
}

is_termux() {
declare -p | grep -E 'TERMUX_[A-Z_]+=".+"$'
}

get_editor_from_the_env_var() {
if [ -z $EDITOR ]; then
# $EDITOR not set, fallback
Expand Down Expand Up @@ -55,6 +59,8 @@ generate_open_command() {
echo "$(command_generator "open")"
elif is_cygwin; then
echo "$(command_generator "cygstart")"
elif is_termux; then
echo "$(command_generator "termux-open")"
elif command_exists "xdg-open"; then
echo "$(command_generator "xdg-open")"
else
Expand All @@ -69,6 +75,8 @@ generate_open_search_command() {
echo "$(search_command_generator "open" "$engine")"
elif is_cygwin; then
echo "$(command_generator "cygstart")"
elif is_termux; then
echo "$(command_generator "termux-open")"
elif command_exists "xdg-open"; then
echo "$(search_command_generator "xdg-open" "$engine")"
else
Expand Down