[GH-ISSUE #16] [Bug] display issue when running inside tmux #14

Closed
opened 2026-05-05 03:21:54 -06:00 by gitea-mirror · 6 comments
Owner

Originally created by @Cveinnt on GitHub (May 11, 2022).
Original GitHub issue: https://github.com/XuehaiPan/nvitop/issues/16

Runtime Environment

  • Operating system and version: Ubuntu 16.04 LTS
  • Terminal emulator and version: iTerm2 3.4.15
  • Python version: 3.9.7
  • NVML version (driver version): 470.57
  • nvitop version: main@latest
  • Locale: en_US.UTF-8

Current Behavior

When running nvitop inside tmux, the rendered display will become messed up, as shown in the screenshots. This behavior is not present when not using tmux.

Steps to Reproduce

  1. open a tmux session
  2. run nvitop

Images / Videos

scrnsht

Originally created by @Cveinnt on GitHub (May 11, 2022). Original GitHub issue: https://github.com/XuehaiPan/nvitop/issues/16 #### Runtime Environment - Operating system and version: Ubuntu 16.04 LTS - Terminal emulator and version: iTerm2 3.4.15 - Python version: 3.9.7 - NVML version (driver version): 470.57 - `nvitop` version: main@latest - Locale: en_US.UTF-8 #### Current Behavior When running `nvitop` inside tmux, the rendered display will become messed up, as shown in the screenshots. This behavior is not present when not using tmux. #### Steps to Reproduce 1. open a tmux session 2. run nvitop #### Images / Videos <!-- Only if relevant --> ![scrnsht](https://user-images.githubusercontent.com/30604389/167857603-4ebc430f-e249-461e-a427-5ee5db45ee25.png)
Author
Owner

@XuehaiPan commented on GitHub (May 11, 2022):

Hi @Cveinnt, what's your tmux version?

tmux -V

Is your tmux compiled with ncurses correctly?

I cannot reproduce this on my Ubuntu 16.04 LTS machine with tmux 2.1 and ncurses 5.

<!-- gh-comment-id:1123810342 --> @XuehaiPan commented on GitHub (May 11, 2022): Hi @Cveinnt, what's your `tmux` version? ```bash tmux -V ``` Is your `tmux` compiled with `ncurses` correctly? I cannot reproduce this on my Ubuntu 16.04 LTS machine with `tmux` 2.1 and ncurses 5.
Author
Owner

@Cveinnt commented on GitHub (May 11, 2022):

Hi @XuehaiPan ,
tmux -V yields tmux 2.1 for me.
I installed the package with apt, and have no previous display issue with tmux prior.
The bug only seems to appear when nvitop is in resource monitor mode (in tmux), as nvitop -1 etc. still produces normal display.

<!-- gh-comment-id:1123832416 --> @Cveinnt commented on GitHub (May 11, 2022): Hi @XuehaiPan , `tmux -V` yields `tmux 2.1` for me. I installed the package with `apt`, and have no previous display issue with tmux prior. The bug only seems to appear when `nvitop` is in resource monitor mode (in tmux), as `nvitop -1` etc. still produces normal display.
Author
Owner

@XuehaiPan commented on GitHub (May 11, 2022):

Can you try:

strace tmux -c 'python3 -c "import curses; win = curses.init_scr(); curses.endwin()"' 2>&1 | grep -E '.*curses.*.so'

The bug only seems to appear when nvitop is in resource monitor mode (in tmux), as nvitop -1 etc. still produces normal display.

nvitop -1 will not initialize ncurses window. It just print results to the terminal.

<!-- gh-comment-id:1123850441 --> @XuehaiPan commented on GitHub (May 11, 2022): Can you try: ```python strace tmux -c 'python3 -c "import curses; win = curses.init_scr(); curses.endwin()"' 2>&1 | grep -E '.*curses.*.so' ``` ------ > The bug only seems to appear when `nvitop` is in resource monitor mode (in tmux), as `nvitop -1` etc. still produces normal display. `nvitop -1` will not initialize ncurses window. It just print results to the terminal.
Author
Owner

@Cveinnt commented on GitHub (May 11, 2022):

Here's the output

stat(".../miniconda3/lib/python3.9/curses/__init__.cpython-39-x86_64-linux-gnu.so", 0x7ffe7a0fc580) = -1 ENOENT (No such file or directory)
stat(".../miniconda3/lib/python3.9/curses/__init__.abi3.so", 0x7ffe7a0fc580) = -1 ENOENT (No such file or directory)
stat(".../miniconda3/lib/python3.9/curses/__init__.so", 0x7ffe7a0fc580) = -1 ENOENT (No such file or directory)
stat(".../miniconda3/lib/python3.9/lib-dynload/_curses.cpython-39-x86_64-linux-gnu.so", {st_mode=S_IFREG|0775, st_size=471008, ...}) = 0
open(".../miniconda3/lib/python3.9/lib-dynload/_curses.cpython-39-x86_64-linux-gnu.so", O_RDONLY|O_CLOEXEC) = 3
open(".../miniconda3/lib/python3.9/lib-dynload/../../tls/x86_64/libncursesw.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open(".../miniconda3/lib/python3.9/lib-dynload/../../tls/libncursesw.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open(".../miniconda3/lib/python3.9/lib-dynload/../../x86_64/libncursesw.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open(".../miniconda3/lib/python3.9/lib-dynload/../../libncursesw.so.6", O_RDONLY|O_CLOEXEC) = 3

It looks like python is looking for libncursesw6, when I only have 5.

<!-- gh-comment-id:1123932217 --> @Cveinnt commented on GitHub (May 11, 2022): Here's the output ```bash stat(".../miniconda3/lib/python3.9/curses/__init__.cpython-39-x86_64-linux-gnu.so", 0x7ffe7a0fc580) = -1 ENOENT (No such file or directory) stat(".../miniconda3/lib/python3.9/curses/__init__.abi3.so", 0x7ffe7a0fc580) = -1 ENOENT (No such file or directory) stat(".../miniconda3/lib/python3.9/curses/__init__.so", 0x7ffe7a0fc580) = -1 ENOENT (No such file or directory) stat(".../miniconda3/lib/python3.9/lib-dynload/_curses.cpython-39-x86_64-linux-gnu.so", {st_mode=S_IFREG|0775, st_size=471008, ...}) = 0 open(".../miniconda3/lib/python3.9/lib-dynload/_curses.cpython-39-x86_64-linux-gnu.so", O_RDONLY|O_CLOEXEC) = 3 open(".../miniconda3/lib/python3.9/lib-dynload/../../tls/x86_64/libncursesw.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) open(".../miniconda3/lib/python3.9/lib-dynload/../../tls/libncursesw.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) open(".../miniconda3/lib/python3.9/lib-dynload/../../x86_64/libncursesw.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) open(".../miniconda3/lib/python3.9/lib-dynload/../../libncursesw.so.6", O_RDONLY|O_CLOEXEC) = 3 ``` It looks like python is looking for `libncursesw6`, when I only have 5.
Author
Owner

@XuehaiPan commented on GitHub (May 11, 2022):

@Cveinnt You can uninstall nvitop in your conda environment. Then install it with system Python:

sudo apt install python3-dev python3-pip
/usr/bin/python3 -m pip install --user nvitop
~/.local/bin/nvitop
<!-- gh-comment-id:1123947948 --> @XuehaiPan commented on GitHub (May 11, 2022): @Cveinnt You can uninstall `nvitop` in your conda environment. Then install it with system Python: ```bash sudo apt install python3-dev python3-pip /usr/bin/python3 -m pip install --user nvitop ``` ```bash ~/.local/bin/nvitop ```
Author
Owner

@Cveinnt commented on GitHub (May 11, 2022):

Thanks - this worked for me. Closing the issue now.

<!-- gh-comment-id:1123982786 --> @Cveinnt commented on GitHub (May 11, 2022): Thanks - this worked for me. Closing the issue now.
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#14
No description provided.