这是indexloc提供的服务,不要输入任何密码
Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,11 @@ public boolean isTerminalViewSelected() {
return mActivity.getTerminalToolbarViewPager() == null || mActivity.isTerminalViewSelected() || mActivity.getTerminalView().hasFocus();
}

@Override
public boolean isTerminalViewScalingDisabled() {
return mActivity.getProperties().isTerminalViewScalingDisabled();
}



@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public boolean onScroll(MotionEvent e, float distanceX, float distanceY) {

@Override
public boolean onScale(float focusX, float focusY, float scale) {
if (mEmulator == null || isSelectingText()) return true;
if (mEmulator == null || isSelectingText() || mClient.isTerminalViewScalingDisabled()) return true;
mScaleFactor *= scale;
mScaleFactor = mClient.onScale(mScaleFactor);
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public interface TerminalViewClient {

boolean isTerminalViewSelected();

boolean isTerminalViewScalingDisabled();


void copyModeChanged(boolean copyMode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@
*
* - 0.18.0 (2022-06-13)
* - Add `KEY_DISABLE_FILE_SHARE_RECEIVER` and `KEY_DISABLE_FILE_VIEW_RECEIVER`.
*
* - 0.19.0 (2025-01-23)
* - Add `disable-terminal-view-scaling`.
*/

/**
Expand All @@ -98,6 +101,11 @@ public final class TermuxPropertyConstants {
private static final String LOG_TAG = "TermuxPropertyConstants";

/* boolean */

/** Defines the key for whether terminal view scaling are enabled. */
public static final String KEY_DISABLE_TERMINAL_VIEW_SCALING = "disable-terminal-view-scaling"; // Default: "disable-terminal-view-scaling"



/** Defines the key for whether file share receiver of the app is enabled. */
public static final String KEY_DISABLE_FILE_SHARE_RECEIVER = "disable-file-share-receiver"; // Default: "disable-file-share-receiver"
Expand Down Expand Up @@ -390,7 +398,8 @@ public final class TermuxPropertyConstants {
* Setting this to {@code null} will make {@link SharedProperties} throw an exception.
* */
public static final Set<String> TERMUX_APP_PROPERTIES_LIST = new HashSet<>(Arrays.asList(
/* boolean */
/* boolean */
KEY_DISABLE_TERMINAL_VIEW_SCALING,
KEY_DISABLE_FILE_SHARE_RECEIVER,
KEY_DISABLE_FILE_VIEW_RECEIVER,
KEY_DISABLE_HARDWARE_KEYBOARD_SHORTCUTS,
Expand Down Expand Up @@ -439,6 +448,7 @@ public final class TermuxPropertyConstants {
* default: false
*/
public static final Set<String> TERMUX_DEFAULT_FALSE_BOOLEAN_BEHAVIOUR_PROPERTIES_LIST = new HashSet<>(Arrays.asList(
KEY_DISABLE_TERMINAL_VIEW_SCALING,
KEY_DISABLE_FILE_SHARE_RECEIVER,
KEY_DISABLE_FILE_VIEW_RECEIVER,
KEY_DISABLE_HARDWARE_KEYBOARD_SHORTCUTS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,9 @@ public static String getVolumeKeysBehaviourInternalPropertyValueFromValue(String



public boolean isTerminalViewScalingDisabled() {
return (boolean) getInternalPropertyValue(TermuxPropertyConstants.KEY_DISABLE_TERMINAL_VIEW_SCALING, true);
}

public boolean shouldAllowExternalApps() {
return (boolean) getInternalPropertyValue(TermuxConstants.PROP_ALLOW_EXTERNAL_APPS, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ public class TermuxTerminalViewClientBase implements TerminalViewClient {
public TermuxTerminalViewClientBase() {
}

@Override
public boolean isTerminalViewScalingDisabled() {
return false;
}

@Override
public float onScale(float scale) {
return 1.0f;
Expand Down