Fixed: Fix termux session shortcuts not working after TermuxActivity recreation

The `List<KeyboardShortcut> mSessionShortcuts = new ArrayList<>()` declaration was causing shortcuts list to be of size 0 in `TermuxTerminalViewClient.onCodePoint()` after re-creation, which resulted in session shortcuts not working.
This commit is contained in:
agnostic-apollo
2022-01-28 02:03:37 +05:00
parent 81dd113157
commit 4fd48a5aed

View File

@@ -22,7 +22,7 @@ import java.util.Map;
public class TermuxAppSharedProperties extends TermuxSharedProperties {
private ExtraKeysInfo mExtraKeysInfo;
private List<KeyboardShortcut> mSessionShortcuts = new ArrayList<>();
private List<KeyboardShortcut> mSessionShortcuts;
private static final String LOG_TAG = "TermuxAppSharedProperties";
@@ -80,10 +80,7 @@ public class TermuxAppSharedProperties extends TermuxSharedProperties {
* Set the terminal sessions shortcuts.
*/
private void setSessionShortcuts() {
if (mSessionShortcuts == null)
mSessionShortcuts = new ArrayList<>();
else
mSessionShortcuts.clear();
// The {@link TermuxPropertyConstants#MAP_SESSION_SHORTCUTS} stores the session shortcut key and action pair
for (Map.Entry<String, Integer> entry : TermuxPropertyConstants.MAP_SESSION_SHORTCUTS.entrySet()) {