diff --git a/README.md b/README.md index f1db39db24..c96321312e 100644 --- a/README.md +++ b/README.md @@ -1,65 +1,3 @@ # Termux application -[![Build status](https://github.com/termux/termux-app/workflows/Build/badge.svg)](https://github.com/termux/termux-app/actions) -[![Testing status](https://github.com/termux/termux-app/workflows/Unit%20tests/badge.svg)](https://github.com/termux/termux-app/actions) -[![Join the chat at https://gitter.im/termux/termux](https://badges.gitter.im/termux/termux.svg)](https://gitter.im/termux/termux) - -[Termux](https://termux.com) is an Android terminal application and Linux environment. - -- [Termux Reddit community](https://reddit.com/r/termux) -- [Termux Wiki](https://wiki.termux.com/wiki/) -- [Termux Twitter](http://twitter.com/termux/) - -Note that this repository is for the app itself (the user interface and the -terminal emulation). For the packages installable inside the app, see -[termux/termux-packages](https://github.com/termux/termux-packages) - -## Installation - -Termux:Widget application can be obtained from: - -- [Google Play](https://play.google.com/store/apps/details?id=com.termux) -- [F-Droid](https://f-droid.org/en/packages/com.termux/) -- [Kali Nethunter Store](https://store.nethunter.com/en/packages/com.termux/) - -Additionally we provide per-commit debug builds for those who want to try -out the latest features or test their pull request. This build can be obtained -from one of the workflow runs listed on [Github Actions](https://github.com/termux/termux-app/actions) -page. - -Signature keys of all offered builds are different. Before you switch the -installation source, you will have to uninstall the Termux application and -all currently installed plugins. - -## Terminal resources - -- [XTerm control sequences](http://invisible-island.net/xterm/ctlseqs/ctlseqs.html) -- [vt100.net](http://vt100.net/) -- [Terminal codes (ANSI and terminfo equivalents)](http://wiki.bash-hackers.org/scripting/terminalcodes) - -## Terminal emulators - -- VTE (libvte): Terminal emulator widget for GTK+, mainly used in gnome-terminal. - [Source](https://github.com/GNOME/vte), [Open Issues](https://bugzilla.gnome.org/buglist.cgi?quicksearch=product%3A%22vte%22+), - and [All (including closed) issues](https://bugzilla.gnome.org/buglist.cgi?bug_status=RESOLVED&bug_status=VERIFIED&chfield=resolution&chfieldfrom=-2000d&chfieldvalue=FIXED&product=vte&resolution=FIXED). - -- iTerm 2: OS X terminal application. [Source](https://github.com/gnachman/iTerm2), - [Issues](https://gitlab.com/gnachman/iterm2/issues) and [Documentation](http://www.iterm2.com/documentation.html) - (which includes [iTerm2 proprietary escape codes](http://www.iterm2.com/documentation-escape-codes.html)). - -- Konsole: KDE terminal application. [Source](https://projects.kde.org/projects/kde/applications/konsole/repository), - in particular [tests](https://projects.kde.org/projects/kde/applications/konsole/repository/revisions/master/show/tests), - [Bugs](https://bugs.kde.org/buglist.cgi?bug_severity=critical&bug_severity=grave&bug_severity=major&bug_severity=crash&bug_severity=normal&bug_severity=minor&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&product=konsole) - and [Wishes](https://bugs.kde.org/buglist.cgi?bug_severity=wishlist&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&product=konsole). - -- hterm: JavaScript terminal implementation from Chromium. [Source](https://github.com/chromium/hterm), - including [tests](https://github.com/chromium/hterm/blob/master/js/hterm_vt_tests.js), - and [Google group](https://groups.google.com/a/chromium.org/forum/#!forum/chromium-hterm). - -- xterm: The grandfather of terminal emulators. - [Source](http://invisible-island.net/datafiles/release/xterm.tar.gz). - -- Connectbot: Android SSH client. [Source](https://github.com/connectbot/connectbot) - -- Android Terminal Emulator: Android terminal app which Termux terminal handling - is based on. Inactive. [Source](https://github.com/jackpal/Android-Terminal-Emulator). +Termux的魔改版.... diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 1fbdab95a9..5374f37c78 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -52,6 +52,14 @@ android:exported="false" android:theme="@android:style/Theme.Material.Light.DarkActionBar" android:parentActivityName=".app.TermuxActivity" + android:resizeableActivity="true" + android:label="@string/application_name" /> + + diff --git a/app/src/main/java/com/termux/app/TermuxActivity.java b/app/src/main/java/com/termux/app/TermuxActivity.java index ae61b30217..87006d7302 100644 --- a/app/src/main/java/com/termux/app/TermuxActivity.java +++ b/app/src/main/java/com/termux/app/TermuxActivity.java @@ -95,6 +95,8 @@ public final class TermuxActivity extends Activity implements ServiceConnection private static final int MAX_SESSIONS = 8; + private static final int CONTEXTMENU_TEST = 10; + private static final int REQUESTCODE_PERMISSION_STORAGE = 1234; private static final String RELOAD_STYLE_ACTION = "com.termux.app.reload_style"; @@ -660,6 +662,8 @@ public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuIn menu.add(Menu.NONE, CONTEXTMENU_STYLING_ID, Menu.NONE, R.string.style_terminal); menu.add(Menu.NONE, CONTEXTMENU_TOGGLE_KEEP_SCREEN_ON, Menu.NONE, R.string.toggle_keep_screen_on).setCheckable(true).setChecked(mSettings.isScreenAlwaysOn()); menu.add(Menu.NONE, CONTEXTMENU_HELP_ID, Menu.NONE, R.string.help); + menu.add(Menu.NONE, CONTEXTMENU_TEST, Menu.NONE, "测试"); + } /** Hook system menu to show context menu instead. */ @@ -857,6 +861,9 @@ public boolean onContextItemSelected(MenuItem item) { } return true; } + case CONTEXTMENU_TEST: + startActivity(new Intent(this, TermuxFunctionActivity.class)); + return true; case CONTEXTMENU_HELP_ID: startActivity(new Intent(this, TermuxHelpActivity.class)); return true; diff --git a/app/src/main/java/com/termux/app/TermuxFunctionActivity.java b/app/src/main/java/com/termux/app/TermuxFunctionActivity.java new file mode 100644 index 0000000000..393b37a7b3 --- /dev/null +++ b/app/src/main/java/com/termux/app/TermuxFunctionActivity.java @@ -0,0 +1,11 @@ +package com.termux.app; +import android.app.Activity; +import android.os.Bundle; +import com.termux.R; +public final class TermuxFunctionActivity extends Activity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.function); + } +} diff --git a/app/src/main/java/com/termux/app/TermuxPreferences.java b/app/src/main/java/com/termux/app/TermuxPreferences.java index 1fbac2b70e..84d6d2060b 100644 --- a/app/src/main/java/com/termux/app/TermuxPreferences.java +++ b/app/src/main/java/com/termux/app/TermuxPreferences.java @@ -182,7 +182,7 @@ void reloadFromProperties(Context context) { mUseDarkUI = props.getProperty("use-black-ui", "false"); try { - JSONArray arr = new JSONArray(props.getProperty("extra-keys", "[['ESC', 'TAB', 'CTRL', 'ALT', '-', 'DOWN', 'UP']]")); + JSONArray arr = new JSONArray(props.getProperty("extra-keys", "[['ESC','/','-','HOME','UP','END','PGUP'],['TAB','CTRL','ALT','LEFT','DOWN','RIGHT','PGDN']]")); mExtraKeys = new String[arr.length()][]; for (int i = 0; i < arr.length(); i++) { diff --git a/app/src/main/res/layout/function.xml b/app/src/main/res/layout/function.xml new file mode 100644 index 0000000000..3fe9156d9a --- /dev/null +++ b/app/src/main/res/layout/function.xml @@ -0,0 +1,11 @@ + + + + + +