Skip to main content

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:

  1. Termux - A terminal emulator for Android
  2. 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)

  1. Open your mobile browser
  2. Visit: https://f-droid.org/en/packages/com.termux/
  3. Scroll down and there will be a stable version with "Download APK" text. Click on that to download.
  4. Open the downloaded APK file to install

Option 2: Download from GitHub

  1. Open your mobile browser
  2. Visit: https://github.com/termux/termux-app/releases
  3. Scroll down to the "Assets" section of the latest release
  4. Download the APK file (it will be named something like termux-app_v*.apk)
  5. Open the downloaded APK file to install
  6. You may need to allow installation from unknown sources in your device settings
warning

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

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

  1. Open the SrcNexus Code Editor app
  2. Go to the home screen
  3. Tap the tools icon at the bottom (looks like a wrench or settings icon)
  4. Select "Open Terminal"

Opening the Terminal in a Project

  1. Open any project in SrcNexus Code Editor
  2. Tap the terminal icon in the top toolbar above editor