mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-05 18:25:31 +08:00
Added: Init TermuxShellEnvironment
at app startup
This will currently cache `TermuxAppShellEnvironment` so that its not regenerated for each shell started since it contains some slightly expensive operations.
This commit is contained in:
@@ -60,6 +60,9 @@ public class TermuxApplication extends Application {
|
||||
}
|
||||
|
||||
TermuxAmSocketServer.setupTermuxAmSocketServer(context);
|
||||
|
||||
// Init TermuxShellEnvironment constants and caches after everything has been setup including termux-am-socket server
|
||||
TermuxShellEnvironment.init(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -28,6 +28,11 @@ public class TermuxShellEnvironment extends AndroidShellEnvironment {
|
||||
shellCommandShellEnvironment = new TermuxShellCommandShellEnvironment();
|
||||
}
|
||||
|
||||
/** Init {@link TermuxShellEnvironment} constants and caches. */
|
||||
public synchronized static void init(@NonNull Context currentPackageContext) {
|
||||
TermuxAppShellEnvironment.setTermuxAppEnvironment(currentPackageContext);
|
||||
}
|
||||
|
||||
/** Get shell environment for Termux. */
|
||||
@NonNull
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user