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
857 stars 106 forks source link

Prompt returns to the top of the window instead of 'left off' location #60

Open moyiz opened 7 years ago

moyiz commented 7 years ago

I'm not sure how to describe this issue properly so I've attached some screenshots. I start with a some what clean 3 window setup: screenshot at 2017-04-22 12-47-26

Then, I run some commands so the prompt will be lower in the window, and launch vim: screenshot at 2017-04-22 12-48-50

When I exit vim, the prompt returns to the top of the window, as you can see in the following screenshots (the cursor blinks on the 'l' of the 'locate' command). The desired behavior is for it to return at the same location where a CLI program was called. screenshot at 2017-04-22 12-49-15

After pressing some 'Enter's you can see that the prompt overrides outputs from previous commands. screenshot at 2017-04-22 12-51-33

I'm using mate-terminal + abduco + dvtm. I tried to mess a bit with DVTM_TERM / TERM, and tried using xterm instead of mate-terminal, but I get the same result. To be honest, I am not sure what causing it or even if it is a dvtm issue.

Thanks. (Edit: Fixed a typo) (Update: Solved by setting TERM as 'rxvt-256color' in bashrc, not sure why though)

ghost commented 7 years ago

It looks related to the \033[?1049h escape sequence vim sends to save screen content and cursor position, and \033[?1049l used to restore screen and cursor position.

I can reproduce the issue with this in dvtm:

ls -a
printf '\033[?1049h'
pwd
printf '\033[?1049l'

May be related to vt.c#L968.