martanne / dvtm

dvtm brings the concept of tiling window management, popularized by X11-window managers like dwm to the console. As a console window manager it tries to make it easy to work with multiple console based programs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Repaint/Redraw issue

zmingee opened this issue · comments

I've been using dvtm + abduco for a couple weeks now and I love it, all except for one issue I can't seem to figure out.

When using dvtm + abduco, there seems to be a redrawing issue when using ncurses/TUI's. For instance, if I type a few commands, open up vim, then close it, the cursor moves to the top of the screen, but the whole page isn't repainted/redrew.

$xerxes> dvtm -v
dvtm-v0.15-37-gb45828d-dirty © 2007-2016 Marc André Tanner
$xerxes> abduco -v
abduco-0.6 © 2013-2016 Marc André Tanner
$xerxes> st -v
st 0.7 (c) 2010-2016 st engineers

I do know C, so I can help, but I've never worked on a code base for something like this so I'd be a little lost at first. More than happy to help though!

Example:

BEFORE
[1][2][3][4][5][ ][                                                                                ]
──[#1]──────────────────────────────────────────────────────────────────────────────────────────────
$xerxes> cd ~/Desktop/
$xerxes> touch file1
$xerxes> echo "Hello!"
Hello!
$xerxes> vim
AFTER
[1][2][3][4][5][ ][                                                                                ]
──[#1]──────────────────────────────────────────────────────────────────────────────────────────────
$xerxes> oh godesktop/
bash: oh: command not found
$xerxes> problem!llo!"
Hello!
$xerxes> vim

EDIT
Here's some more info, random stuff in case you need it.

$xerxes> uname -a
Linux xerxes 4.11.7-1-ARCH #1 SMP PREEMPT Sat Jun 24 09:07:09 CEST 2017 x86_64 GNU/Linux
$xerxes> screenfetch
                   -`
                  .o+`                 zane@xerxes
                 `ooo/                 OS: Arch Linux
                `+oooo:                Kernel: x86_64 Linux 4.11.7-1-ARCH
               `+oooooo:               Uptime: 36m
               -+oooooo+:              Packages: 928
             `/:-:++oooo+:             Shell: bash 4.4.12
            `/++++/+++++++:            Resolution: 1792x1008
           `/++++++++++++++:           WM: dwm
          `/+++ooooooooooooo/`         GTK Theme:  NumixSolarizedDark [GTK3]
         ./ooosssso++osssssso+`        CPU: Intel Core i7-4850HQ @ 8x 800MHz [45.0°C]
        .oossssso-````/ossssss+`       GPU: nouveaufb
       -osssssso.      :ssssssso.      RAM: 536MiB / 15960MiB
      :osssssss/        osssso+++.
     /ossssssss/        +ssssooo/-
   `/ossssso+/:-        -:/+osssso+-
  `+sso+:-`                 `.-/+oso:
 `++:.                           `-/+/
 .`                                 `/

Also, just to note, a CTRL+l (ell) does successfully repaint the screen to what it should look like.

Maybe it's a false alarm? In my ~/.bashrc file I had an export TERM=xterm-256color. I removed this, and dvtm defaulted to dvtm-256color, and now everything seems to be working as it should. If this is the cause, maybe it should be put in the readme?

After a couple days, it seems that setting the TERM environment variable to dvtm-256color fixed my issues. Hopefully it helps someone else out there.

Feel free to close this issue.

Actually, seeing a new issue with that TERM variable now. When I ssh into a machine that doesn't have dvtm installed and/or dvtm isn't running, most TUIs/ncurses UI's fail because they don't know what dvtm is. So I have to set the TERM variable to something like xterm-256color, which makes the TUIs/ncurses UIs work, but then causes the same issue as before with dvtm not painting/drawing correctly.

[root] super-secret-hostname:~ # less .bashrc
WARNING: terminal is not fully functional
.bashrc  (press RETURN)

For the record, I fixed the above issue by setting a bash alias that sets the TERM variable before running SSH. Problem solved. (In case anyone else needs this)

If anyone else bumps into this and finds this issue: this works well for me:

alias ssh='TERM=xterm-256color ssh'

@nbostrom Yeah, that's exactly what I have and can confirm it works.

However, there is still an issue with repainting in general in the SSH session. If you open a full TUI application such as vim or less, after you close it the "cursor" goes to the top of the screen, but the previous command text is still there. You have to manually issue a repaint to get it to go away, or clear/reset the TTY.