为什么 htop 命令显示黑屏

why is htop command displaying a black screen

首先,我是 linux 的新手,我在按照教程尝试 windows wsl 时,启用它并下载 ubuntu... 一切正常美好的。但是当我尝试 运行 htop 时,它只是返回一个黑色的冻结屏幕。我做了 strace htop 2> strace_log.txtthis is the result,但我不知道发生了什么事,有人可以帮忙吗

这是一个错误,由涉及 WSL 中 CLOCK_REALTIME 的不兼容 glibc 调用引起。

来自bugs.launchpad.net/ubuntu/+source/htop/+bug/1871129

The issue is happening because WSL is currently not POSIX compliant and any call to glibc that uses CLOCK_REALTIME will fail with EINVAL (-1) (such as clock_gettime() or clock_nanosleep()). It is likely that a glibc change has made this to appear (instead of the htop different version).

相关:

简而言之,如果您使用的是 WSL1,请使用 UBUNTU 20.04 改为使用 18.04