[GH-ISSUE #175] [BUG] The conda distribution has TERM-related problems #111

Open
opened 2026-05-05 03:25:46 -06:00 by gitea-mirror · 5 comments
Owner

Originally created by @Yura52 on GitHub (Jul 30, 2025).
Original GitHub issue: https://github.com/XuehaiPan/nvitop/issues/175

Originally assigned to: @XuehaiPan on GitHub.

Required prerequisites

  • I have read the documentation https://nvitop.readthedocs.io.
  • I have searched the Issue Tracker that this hasn't already been reported. (comment there if it has.)
  • I have tried the latest version of nvitop in a new isolated virtual environment.

What version of nvitop are you using?

1.5.2

Operating system and version

Ubuntu 22.04

NVIDIA driver version

550.163.01

NVIDIA-SMI


Python environment

No environment is needed

Problem description

I use the Ghostty terminal emulator and I have an issue with nvitop described here:
https://github.com/ghostty-org/ghostty/discussions/8097

I noticed that there are similar issues in the repository (e.g. #118), but the suggested solution requires patching the terminal-related environment variables, which I would like to avoid. After a quick investigation, it seems that the problem is specifically in the Conda distribution of nvitop, not in Ghostty.

Steps to Reproduce

This works fine:

uvx nvitop

However, this fails:

pixi exec nvitop

Or, if you prefer conda:

conda create -n nvitop-conda-bug -y nvitop
conda run -n nvitop-conda-bug nvitop

Traceback


Logs


Expected behavior

No response

Additional context

No response

Originally created by @Yura52 on GitHub (Jul 30, 2025). Original GitHub issue: https://github.com/XuehaiPan/nvitop/issues/175 Originally assigned to: @XuehaiPan on GitHub. ### Required prerequisites - [x] I have read the documentation <https://nvitop.readthedocs.io>. - [x] I have searched the [Issue Tracker](https://github.com/XuehaiPan/nvitop/issues) that this hasn't already been reported. (comment there if it has.) - [x] I have tried the latest version of nvitop in a new isolated virtual environment. ### What version of nvitop are you using? 1.5.2 ### Operating system and version Ubuntu 22.04 ### NVIDIA driver version 550.163.01 ### NVIDIA-SMI ```text ``` ### Python environment No environment is needed ### Problem description I use the Ghostty terminal emulator and I have an issue with nvitop described here: https://github.com/ghostty-org/ghostty/discussions/8097 I noticed that there are similar issues in the repository (e.g. #118), but the suggested solution requires patching the terminal-related environment variables, which I would like to avoid. After a quick investigation, it seems that the problem is specifically in the Conda distribution of `nvitop`, not in Ghostty. ### Steps to Reproduce This works fine: ``` uvx nvitop ``` However, this fails: ``` pixi exec nvitop ``` Or, if you prefer conda: ``` conda create -n nvitop-conda-bug -y nvitop conda run -n nvitop-conda-bug nvitop ``` ### Traceback ```pytb ``` ### Logs ```text ``` ### Expected behavior _No response_ ### Additional context _No response_
gitea-mirror added the
bug
upstream
labels 2026-05-05 03:25:46 -06:00
Author
Owner

@XuehaiPan commented on GitHub (Jul 30, 2025):

@Yura52, I think it is related to the conda provided Python, not nvitop.

I noticed that there are similar issues in the repository (e.g. https://github.com/XuehaiPan/nvitop/issues/118), but the suggested solution requires patching the terminal-related environment variables, which I would like to avoid.

You may add a per-environment activation script here:

${CONDA_PREFIX}/etc/conda/activate.d/*.sh

for your conda environment. Those files will be sourced when you activate the environment.

For example:

conda activate xxx
echo 'export TERM="xterm-256color"' > "${CONDA_PREFIX}/etc/conda/activate.d/terminfo.sh"
echo 'export TERMINFO="${CONDA_PREFIX}/share/terminfo"' >> "${CONDA_PREFIX}/etc/conda/activate.d/terminfo.sh"
<!-- gh-comment-id:3135484846 --> @XuehaiPan commented on GitHub (Jul 30, 2025): @Yura52, I think it is related to the conda provided Python, not `nvitop`. > I noticed that there are similar issues in the repository (e.g. https://github.com/XuehaiPan/nvitop/issues/118), but the suggested solution requires patching the terminal-related environment variables, which I would like to avoid. You may add a per-environment activation script here: ```bash ${CONDA_PREFIX}/etc/conda/activate.d/*.sh ``` for your conda environment. Those files will be sourced when you activate the environment. For example: ```bash conda activate xxx echo 'export TERM="xterm-256color"' > "${CONDA_PREFIX}/etc/conda/activate.d/terminfo.sh" echo 'export TERMINFO="${CONDA_PREFIX}/share/terminfo"' >> "${CONDA_PREFIX}/etc/conda/activate.d/terminfo.sh" ```
Author
Owner

@Yura52 commented on GitHub (Jul 30, 2025):

@xhochy Hi! Tagging you as one of the Conda Python feedstock contributors. We are discussing an error where the Conda distribution of Python may be the root cause. Perhaps, you can give us a hint whether this is true and how to fix the issue.

TL;DR

When using the Ghostty terminal emulator and being connected to a remote Linux machine (after configuring terminfo as explained here), the following works:

uvx nvitop

However, the following fails:

pixi exec nvitop

But the following works:

TERM=xterm-256color pixi exec nvitop

That is, the Conda distribution of the nvitop tool fails without patching the TERM environment variable, and @XuehaiPan suggests that specifically the Conda Python interpreter can be the reason.

<!-- gh-comment-id:3135530105 --> @Yura52 commented on GitHub (Jul 30, 2025): @xhochy Hi! Tagging you as one of the [Conda Python feedstock](https://github.com/conda-forge/python-feedstock) contributors. We are discussing an error where the Conda distribution of Python may be the root cause. Perhaps, you can give us a hint whether this is true and how to fix the issue. **TL;DR** When using the [Ghostty](https://ghostty.org) terminal emulator and being connected to a remote Linux machine (after configuring terminfo as explained [here](https://ghostty.org/docs/help/terminfo#copy-ghostty's-terminfo-to-a-remote-machine)), the following works: ``` uvx nvitop ``` However, the following fails: ``` pixi exec nvitop ``` But the following works: ``` TERM=xterm-256color pixi exec nvitop ``` That is, the Conda distribution of the `nvitop` tool fails without patching the TERM environment variable, and @XuehaiPan suggests that specifically the Conda Python interpreter can be the reason.
Author
Owner

@xhochy commented on GitHub (Nov 16, 2025):

The issue is quite vague. Do you have an error message or a traceback?

<!-- gh-comment-id:3538430860 --> @xhochy commented on GitHub (Nov 16, 2025): The issue is quite vague. Do you have an error message or a traceback?
Author
Owner

@Yura52 commented on GitHub (Nov 16, 2025):

The issue is quite vague. Do you have an error message or a traceback?

I provided more details here when describing the bug:
https://github.com/ghostty-org/ghostty/discussions/8097

Note that at the end of the discussion, I came to the conclusion that specifically the Conda dstribution of nvitop is the issue, then opened this issue, and then the main hypothesis became that the Conda distribution of Python itself is the issue.

<!-- gh-comment-id:3538441592 --> @Yura52 commented on GitHub (Nov 16, 2025): > The issue is quite vague. Do you have an error message or a traceback? I provided more details here when describing the bug: https://github.com/ghostty-org/ghostty/discussions/8097 Note that at the end of the discussion, I came to the conclusion that specifically the Conda dstribution of `nvitop` is the issue, then opened this issue, and then the main hypothesis became that the Conda distribution of _Python_ itself is the issue.
Author
Owner

@xhochy commented on GitHub (Dec 10, 2025):

I looked into this and the ncurses build on conda-forge, and I'm also a Ghostty user, and for me, it works fine for me. As I cannot reproduce, you will need to fine more debug information on what could possibly go wrong.

<!-- gh-comment-id:3636724864 --> @xhochy commented on GitHub (Dec 10, 2025): I looked into this and the `ncurses` build on conda-forge, and I'm also a Ghostty user, and for me, it works fine for me. As I cannot reproduce, you will need to fine more debug information on what could possibly go wrong.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/nvitop#111
No description provided.