Skip to content

Commit b2a6487

Browse files
Added: Allow users to disable termux-am server
The user can add `run-termux-am-socket-server=false` entry to `termux.properties` file to disable the `termux-am` server to run at app startup which is connected to by `$PREFIX/bin/termux-am` from the `termux-am-socket` package. The default value is `true`. Changes require `termux-app` to be force stopped and restarted to provide consistent state for all termux sessions and tasks. The prop will be used in a later commit.
1 parent c367ebb commit b2a6487

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

termux-shared/src/main/java/com/termux/shared/termux/settings/properties/TermuxPropertyConstants.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.termux.shared.termux.settings.properties;
22

33
import com.google.common.collect.ImmutableBiMap;
4+
import com.termux.shared.termux.shell.am.TermuxAmSocketServer;
45
import com.termux.shared.theme.NightMode;
56
import com.termux.shared.file.FileUtils;
67
import com.termux.shared.file.filesystem.FileType;
@@ -120,6 +121,11 @@ public final class TermuxPropertyConstants {
120121

121122

122123

124+
/** Defines the key for whether the {@link TermuxAmSocketServer} should be run at app startup */
125+
public static final String KEY_RUN_TERMUX_AM_SOCKET_SERVER = "run-termux-am-socket-server"; // Default: "run-termux-am-socket-server"
126+
127+
128+
123129
/** Defines the key for whether url links in terminal transcript will automatically open on click or on tap */
124130
public static final String KEY_TERMINAL_ONCLICK_URL_OPEN = "terminal-onclick-url-open"; // Default: "terminal-onclick-url-open"
125131

@@ -379,6 +385,7 @@ public final class TermuxPropertyConstants {
379385
KEY_ENFORCE_CHAR_BASED_INPUT,
380386
KEY_EXTRA_KEYS_TEXT_ALL_CAPS,
381387
KEY_HIDE_SOFT_KEYBOARD_ON_STARTUP,
388+
KEY_RUN_TERMUX_AM_SOCKET_SERVER,
382389
KEY_TERMINAL_ONCLICK_URL_OPEN,
383390
KEY_USE_CTRL_SPACE_WORKAROUND,
384391
KEY_USE_FULLSCREEN,
@@ -436,7 +443,8 @@ public final class TermuxPropertyConstants {
436443
* default: true
437444
*/
438445
public static final Set<String> TERMUX_DEFAULT_TRUE_BOOLEAN_BEHAVIOUR_PROPERTIES_LIST = new HashSet<>(Arrays.asList(
439-
KEY_EXTRA_KEYS_TEXT_ALL_CAPS
446+
KEY_EXTRA_KEYS_TEXT_ALL_CAPS,
447+
KEY_RUN_TERMUX_AM_SOCKET_SERVER
440448
));
441449

442450
/** Defines the set for keys loaded by termux that have default inverted boolean behaviour with false as default.

termux-shared/src/main/java/com/termux/shared/termux/settings/properties/TermuxSharedProperties.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,10 @@ public boolean shouldSoftKeyboardBeHiddenOnStartup() {
583583
return (boolean) getInternalPropertyValue(TermuxPropertyConstants.KEY_HIDE_SOFT_KEYBOARD_ON_STARTUP, true);
584584
}
585585

586+
public boolean shouldRunTermuxAmSocketServer() {
587+
return (boolean) getInternalPropertyValue(TermuxPropertyConstants.KEY_RUN_TERMUX_AM_SOCKET_SERVER, true);
588+
}
589+
586590
public boolean shouldOpenTerminalTranscriptURLOnClick() {
587591
return (boolean) getInternalPropertyValue(TermuxPropertyConstants.KEY_TERMINAL_ONCLICK_URL_OPEN, true);
588592
}

0 commit comments

Comments
 (0)