Terminal Storage and Access
Relevant source files
The following files were used as context for generating this wiki page:
Acode provides a full Linux terminal environment using proot with Alpine Linux. This system enables users to execute command-line tools, manage packages via apk, and interact with the Android file system directly through a shell interface. The terminal operates as a foreground service, remaining active in the background until the user closes it or the device terminates the process.
Sources: user-guide/terminal.md:1-12, user-guide/index.md:38-42
Storage Hierarchy and Permissions
The terminal environment categorizes storage access into three primary zones. Access to these zones depends on system permissions and the specific version of the Acode application.
| Location | Access Level | Requirements |
|---|---|---|
Home directory (/home) | Always accessible | None |
| Public folder | Always accessible | None |
| Internal storage | Restricted | Requires All Files Access permission; Android 10+; Non-Play Store version |
Sources: user-guide/terminal.md:27-31, user-guide/settings/terminal-settings.md:5-9
Internal Storage Access
Users grant terminal access to the device's internal storage through the All Files Access toggle in Terminal Settings. This permission is unavailable in the Google Play Store version of the application due to platform restrictions.
Sources: user-guide/settings/terminal-settings.md:9, user-guide/terminal.md:104-108
Terminal Initialization and Configuration
The terminal executes a specific startup sequence every time a session begins. It utilizes the /initrc script to prepare the environment.
Initialization Flow
The following diagram illustrates the sequence of operations when a new terminal tab opens:
This diagram shows the boot sequence of the Alpine Linux environment within Acode, highlighting the central role of the /initrc file.
Sources: user-guide/terminal.md:73-89
Customization Files
Users modify terminal behavior and appearance by editing standard shell configuration files:
~/.bashrc: User-specific shell configurations./etc/profile: System-wide environment settings./initrc: Acode-specific startup script for aliases, prompts (PS1), and environment variables likeEDITOR.
Sources: user-guide/terminal.md:65-71, user-guide/terminal.md:75-81
Acode CLI Integration
The terminal includes a built-in acode command-line utility. This tool bridges the gap between the Linux shell and the Acode editor interface, allowing file manipulation from the command line.
CLI Commands
| Command | Action |
|---|---|
acode <filename> | Opens the specified file in an editor tab. |
acode . | Opens the current terminal directory in the Acode file browser. |
acode ~/project | Opens a specific directory in the editor. |
acode --help | Displays available CLI options. |
Sources: user-guide/terminal.md:54-63
External Terminal Integration
While Acode provides a built-in terminal, it also supports integration with external Linux environments like Termux. This requires the installation of specific plugins, such as AcodeX, and a server component running within the external terminal environment.
The sequence diagram demonstrates the communication between Acode and an external terminal emulator via a plugin-mediated server.
Sources: tutorials/how-to-run-java.md:55-75
Installation and Maintenance
The terminal system provides tools for lifecycle management, including backup and recovery of the Alpine Linux installation.
Maintenance Actions
- Backup: Creates a snapshot of the terminal installation and all user configurations.
- Restore: Reverts the terminal to a previously created backup state.
- Uninstall: Removes the Alpine Linux environment and all associated data from the device.
Sources: user-guide/terminal.md:95-100, user-guide/settings/terminal-settings.md:31-35
Troubleshooting Storage Access
If the terminal fails to access files or start correctly, verify the following conditions:
- Storage Space: Ensure the device has sufficient free space for the Alpine Linux container.
- Permission State: Confirm All Files Access is enabled in Terminal Settings for Android 10+ devices.
- App Source: Verify the app version, as Play Store builds lack full internal storage access.
- Environment Reset: Use the Uninstall and reinstall process from Terminal Settings to resolve corrupted installations.
Sources: user-guide/terminal.md:102-113, user-guide/settings/terminal-settings.md:5-9