Skip to content

Micro hangs on startup (black screen) in Termux environment when termux-api is installed #3947

@nullpc

Description

@nullpc

On modern Android devices (Android 13/14, specifically tested on Poco M5), the micro editor hangs indefinitely on a black screen during the initialization phase if the termux-api package is installed in the environment. This appears to be a synchronous blocking call to the system clipboard that never receives a response from the Android OS.

Steps to Reproduce :

  1. Install Termux on an Android 13+ device.
  2. Install the micro editor: pkg install micro.
  3. Install the termux-api package: pkg install termux-api.
  4. Attempt to open any file or the editor itself: micro test.txt.

The terminal remains on a blank/black screen and does not respond to input.

Technical Diagnosis (Root Cause Analysis) : The issue is a Synchronous Blocking I/O hang. When termux-api is present, micro attempts to interface with the Android system clipboard. Due to Android's strict background execution limits and phantom process restrictions, the system call to the clipboard bridge does not return a value. Because micro does not have an internal timeout for this initialization step, the process enters a deadlock state, awaiting a response from the termux-api service that never arrives.

Workaround Found: Bypassing the system clipboard call by using the internal clipboard flag resolves the issue immediately: micro -clipboard internal [filename]

Environment :
Device: Poco M5 (Android 13/14)
Terminal: Termux
Editor Version: Latest available via pkg install (2.0.13+)
Dependency: termux-api installed.

Additional Context
Mentioning @termux for visibility, as this affects the user expericeen for developers using the Termux environment on modern Android versions. This bug appears to be an integration conflict between the editor's clboipard handling and the Termux-API bridge.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions