github上给出的操作步骤。GitHub - XuehaiPan/nvitop: An interactive NVIDIA-GPU process viewer and beyond, the one-stop solution for GPU process management.
coloring: --colorful Use gradient colors to get spectrum-like bar charts. This option is only available when the terminal supports 256 colors. You may need to set environment variable `TERM="xterm-256color"`. Note that the terminal multiplexer, such as `tmux`, may override the `TREM` variable.
颜色选项: --colorful 使用渐变颜色创建类似光谱的条形图。此选项仅在终端支持256种颜色时可用。 当终端支持256种颜色时,您可能需要设置环境变量 TERM="xterm-256color"
。请注意,终端复用程序(例如 tmux
)可能会覆盖 TERM
变量。
具体操作:
在终端中输入以下命令,将TERM
环境变量设置为xterm-256color
:
export TERM=xterm-256color
这将在当前终端会话中临时设置TERM
环境变量为xterm-256color
。请注意,这种方式设置的环境变量只在当前终端窗口中有效,关闭窗口后将失效。
永久设置环境变量:
要永久设置TERM
环境变量,您可以将上述命令添加到您的bash配置文件(例如.bashrc
或.bash_profile
)中,这样每次打开新的终端窗口时,TERM
环境变量都会被自动设置为xterm-256color
。在文件的末尾添加,然后source即可。
设置完成后如下图所示。
页面提供信息解释