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

未关闭
#3,947 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 3 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
android, go
领域
cli, mobile-dev

调研方向

首先,在安装了 termux-api 的 Termux 环境中复现挂起问题,然后比较使用默认剪贴板处理方式和 -clipboard internal 时的启动情况。跟踪初始化阶段对系统剪贴板的调用,并验证正常启动不再阻塞,同时剪贴板功能仍然可用。

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Go
星标
29.8k
派生
1.4k
平均合并
1 天 12 小时
30 天内合并 PR
2

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

micro-editor/micro 的其他 Issue

查看 micro-editor/micro 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。