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://srcnexus.com/term/install.sh | bash
What this does: This downloads and installs the terminal server that bridges SrcNexus Code Editor and Termux.
If the installation fails, 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:
term
What this does: This starts the terminal server. SrcNexus Code Editor will connect to it to execute commands.
What you should see: When you run term for the first time, it will display an authentication key in the terminal. You'll need this key in the next step.
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 term every time you restart Termux or your device.
Part 5: Connecting SrcNexus Code Editor to the Server
Now that the server is running, let's connect SrcNexus Code Editor to it.
Enter the Authentication Key
- Open the SrcNexus Code Editor app
- Go to the terminal section — a popup will appear asking for the authentication key
- Copy the key shown in Termux when you ran
term - Paste the key into the popup
- Tap Connect
Stop the server in Termux (press Ctrl+C) and run term --reset to generate a new authentication key.
Using Terminal in SrcNexus Code Editor
Once connected, you can open the terminal:
- 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