From 883d6dc5b019149c595dc257627c7f38ba2622d4 Mon Sep 17 00:00:00 2001 From: agnostic-apollo Date: Wed, 30 Jun 2021 03:04:56 +0500 Subject: [PATCH] Add termux.properties property for opening terminal transcript urls on click The user can add `terminal-onclick-url-open` entry to `termux.properties` file to enable opening url links in terminal transcript on click or on tap. The default value is `false`. So adding the entry `terminal-onclick-url-open=true` to `termux.properties` file will enable url opening. Running `termux-reload-settings` command will also update the behaviour instantaneously if changed. This commit just adds the property and doesn't implement the functionality. That will later be merged from #2146. --- .../settings/properties/TermuxPropertyConstants.java | 7 +++++++ .../shared/settings/properties/TermuxSharedProperties.java | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/termux-shared/src/main/java/com/termux/shared/settings/properties/TermuxPropertyConstants.java b/termux-shared/src/main/java/com/termux/shared/settings/properties/TermuxPropertyConstants.java index b9f7a6e18d..cb3b352bea 100644 --- a/termux-shared/src/main/java/com/termux/shared/settings/properties/TermuxPropertyConstants.java +++ b/termux-shared/src/main/java/com/termux/shared/settings/properties/TermuxPropertyConstants.java @@ -94,6 +94,11 @@ public final class TermuxPropertyConstants { + /** Defines the key for whether url links in terminal transcript will automatically open on click or on tap */ + public static final String KEY_TERMINAL_ONCLICK_URL_OPEN = "terminal-onclick-url-open"; // Default: "terminal-onclick-url-open" + + + /** Defines the key for whether to use black UI */ public static final String KEY_USE_BLACK_UI = "use-black-ui"; // Default: "use-black-ui" @@ -301,6 +306,7 @@ public final class TermuxPropertyConstants { KEY_DISABLE_TERMINAL_SESSION_CHANGE_TOAST, KEY_ENFORCE_CHAR_BASED_INPUT, KEY_HIDE_SOFT_KEYBOARD_ON_STARTUP, + KEY_TERMINAL_ONCLICK_URL_OPEN, KEY_USE_BLACK_UI, KEY_USE_CTRL_SPACE_WORKAROUND, KEY_USE_FULLSCREEN, @@ -341,6 +347,7 @@ public final class TermuxPropertyConstants { KEY_DISABLE_TERMINAL_SESSION_CHANGE_TOAST, KEY_ENFORCE_CHAR_BASED_INPUT, KEY_HIDE_SOFT_KEYBOARD_ON_STARTUP, + KEY_TERMINAL_ONCLICK_URL_OPEN, KEY_USE_CTRL_SPACE_WORKAROUND, KEY_USE_FULLSCREEN, KEY_USE_FULLSCREEN_WORKAROUND, diff --git a/termux-shared/src/main/java/com/termux/shared/settings/properties/TermuxSharedProperties.java b/termux-shared/src/main/java/com/termux/shared/settings/properties/TermuxSharedProperties.java index d87efde735..992c6f2e23 100644 --- a/termux-shared/src/main/java/com/termux/shared/settings/properties/TermuxSharedProperties.java +++ b/termux-shared/src/main/java/com/termux/shared/settings/properties/TermuxSharedProperties.java @@ -476,6 +476,10 @@ public boolean shouldSoftKeyboardBeHiddenOnStartup() { return (boolean) getInternalPropertyValue(TermuxPropertyConstants.KEY_HIDE_SOFT_KEYBOARD_ON_STARTUP, true); } + public boolean shouldOpenTerminalTranscriptURLOnClick() { + return (boolean) getInternalPropertyValue(TermuxPropertyConstants.KEY_TERMINAL_ONCLICK_URL_OPEN, true); + } + public boolean isUsingBlackUI() { return (boolean) getInternalPropertyValue(TermuxPropertyConstants.KEY_USE_BLACK_UI, true); }