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.
MIT License
848 stars 105 forks source link

dvtm damages terminal when resizing #47

Open safinaskar opened 7 years ago

safinaskar commented 7 years ago

Start dvtm, run in it:

for ((I = 1; I <= 100; ++I)) { echo $I; }; mc

Then make outer terminal slightly bigger, then exit from mc. You will see something like this:

92
93
94
95
96
97
  2016-12-19 18:43:31  ~$
99
100

So, terminal clearly corrupted. dvtm 0.15. gnome-terminal 3.22.1. debian stretch.

martanne commented 7 years ago

Thanks for the detailed test case, unfortunately I can't reproduce it here. Did you install the dvtm terminfo entry (i.e. does infocmp dvtm show something sensible)? Also did you try it with latest git master?

Maybe some others (e.g. @josuah) can comment whether they observe the same behavior.

safinaskar commented 7 years ago

dvtm shows big output. Reproducible with git master (b73aba5c17b10eb9bbfaea6abe0de9802225573d) (with terminfo db entry from this git master). I will try to be more precise: run that command, then make terminal window bigger vertically. Such that window will become at least some lines bigger (5 lines will be enough). And then exit from mc.

P. S. Similar bugs present in all terminal multuplexers (i. e. in screen and tmux). This stops me from using them all. If you fix this bug you will be first terminal multiplexer without this bug. This would be very good.

ghost commented 7 years ago

I noticed this as well. And I can reproduce with most programs that have an alternate screen.

Thanks for the notice.

ghost commented 7 years ago

So that we all can look for a fix, the relevant place to search may be around occurence of alternate word in vt.c.

The issue could be somewhere else, but this is where programs tell dvtm that they are a "fullscreen" program and not a command line one.

ghost commented 7 years ago

The cursor position while leaving the fullscreen program does not seems to be at the position of the last prompt, so this works.

Maybe the screen needs to be cleaned before redrawing the previous shell output.

Adding some function to clear the client at the beginning of draw(Client *c)?

[EDIT]: ^ This does not seems to work. I do not know whether it is already handled and does not work or if it was not handled yet.