Terminal
Learn how to use the built-in terminal feature in SrcNexus Code Editor to run commands directly in your projects.
Overview
The Terminal feature in SrcNexus Code Editor allows you to run command-line tools and scripts directly from your mobile device.
Prerequisites
Before you can use the terminal feature in SrcNexus Code Editor, you need to set up a few things on your device:
- Termux - A terminal emulator for Android
- Terminal Server - A bridge that connects SrcNexus Code Editor to Termux
Part 1: Installing Termux
Termux is a powerful terminal emulator that brings Linux command-line tools to your Android device.
How to Install Termux
Option 1: Download from F-Droid (Recommended)
- Open your mobile browser
- Visit: https://f-droid.org/en/packages/com.termux/
- Scroll down and there will be a stable version with "Download APK" text. Click on that to download.
- Open the downloaded APK file to install
Option 2: Download from GitHub
- Open your mobile browser
- Visit: https://github.com/termux/termux-app/releases
- Scroll down to the "Assets" section of the latest release
- Download the APK file (it will be named something like
termux-app_v*.apk) - Open the downloaded APK file to install
- You may need to allow installation from unknown sources in your device settings
Do NOT download Termux from the Google Play Store!
The Play Store version is outdated and no longer maintained. Using it will cause problems later. Always download from F-Droid or GitHub instead.
Update Termux Packages
Once Termux is installed, open it and run this command to update all packages:
apt update && apt upgrade
Part 2: Setting Up Storage Access
For SrcNexus Code Editor and Termux to work together seamlessly, they need to access the same files on your device.
Enable Termux Storage
Run this command in Termux:
termux-setup-storage
When the permission prompt appears, tap "Allow".
Verify Storage Access
Check if storage is accessible:
ls
What you should see: A list of folders, including one called storage. This confirms Termux can now access your device's files!
Part 3: Installing the Terminal Server
The Terminal Server is a small program that allows SrcNexus Code Editor to communicate with Termux and run commands on your behalf.
Install the Server
Run this command in Termux:
curl -sL https://admin.srcnexus.app/term_server_setup/install.sh | bash
What this does: This downloads and installs the terminal server that bridges SrcNexus Code Editor and Termux.
What you should see: After running the command, you should see a message like:
> Done! You can now use the "server" command!If you don't see this message, try running the command again. If the problem persists, contact us at [email protected].
Part 4: Starting the Terminal Server
Before using the terminal in SrcNexus Code Editor, make sure that Termux is running on your device. You also need to start the server in Termux first.
Start the Server
In Termux, run:
server --port 4820
What this does: This starts the terminal server on port 4820. SrcNexus Code Editor will connect to this server to execute commands.
What you should see: A message indicating the server is running and listening for connections.
Keep Termux running in the background while you work in SrcNexus Code Editor. If you close Termux or the server stops, the terminal feature in SrcNexus Code Editor will stop working.
You'll need to run this command every time you restart Termux or your device.
Part 5: Enabling Terminal in SrcNexus Code Editor
Now that the server is running, let's enable the terminal feature in SrcNexus Code Editor.
Using Terminal in SrcNexus Code Editor
- Open the SrcNexus Code Editor app
- Go to the home screen
- Tap the tools icon at the bottom (looks like a wrench or settings icon)
- Select "Open Terminal"
Opening the Terminal in a Project
- Open any project in SrcNexus Code Editor
- Tap the terminal icon in the top toolbar above editor