Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

winpty clears screen in Git Bash #202

Open
jakubsimacek opened this issue Aug 15, 2023 · 3 comments
Open

winpty clears screen in Git Bash #202

jakubsimacek opened this issue Aug 15, 2023 · 3 comments

Comments

@jakubsimacek
Copy link

jakubsimacek commented Aug 15, 2023

Hi, is there a way how to prevent clearing the screen after termination of winpty? (or somehow save and then restore it?)
For example:
(top left corner of the screen)
$ echo xyz
xyz
$ winpty nvim

...after exiting nvim I get:
(top left corner of the screen)
$

and when I scroll up using the scroll bar, there is nothing. The echo xyz and the output has been erased. Only the content that was already scrolled out before executing winpty.

Thanks a lot,
Jakub

@andry81
Copy link

andry81 commented Aug 15, 2023

I am not familiar with the winpty, but it looks like it works with the visible screen and so saves only a visible screen, not the entire console buffer. So may be and even actually it does not clear the screen.

@jakubsimacek
Copy link
Author

It erases the visible screen (overwrites the visible part of the buffer). The nonvisible part is untouched. (all what has been already scolled away remains). So if you had an ouptut of a command on the screen and started something via winpty, it's lost.
Only workaround that crosses my mind is to create a wrapper script which prints x new lines to sroll the content of the screen away so it survives. I hope there is a better solution though.

@andry81
Copy link

andry81 commented Aug 17, 2023

I've tested versus python executable and it does not clear the screen on exit. May be the nvim does it on it's own. What is why only a visible portion has cleared. A workaround here would be copy a screen somethere before nvim exit and then copy it back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants