termpdf.py icon indicating copy to clipboard operation
termpdf.py copied to clipboard

reset terminal on exit

Open jaeheum opened this issue 6 years ago • 22 comments
trafficstars

$ kitty --version kitty 0.14.6 created by Kovid Goyal $ termpdf.py --version 0.1.1

$ termpdf.py some.pdf $ ls -l # no problem $ vi

there is a all black rectangle residue of the pdf in the window, which i can't clear.

jaeheum avatar Nov 04 '19 01:11 jaeheum

hittng M to draw a metadata box before exiting helps (no residue)

jaeheum avatar Nov 04 '19 01:11 jaeheum

Yes. I haven't figured out what is causing this residue. Did not know that showing the metadata first removed the residue. That's a helpful lead.

dsanson avatar Nov 07 '19 18:11 dsanson

Any news on this? I ran into the same problem on MacOS X with homebrew which, given that I use termpdf.py to show PDF attachments in neomutt, is pretty annoying.

Hitting M does NOT help in my case and neither does reset on the terminal. I have to close the terminal window.

andreas-bulling avatar Mar 04 '20 11:03 andreas-bulling

No, no progress. And yes, it is annoying.

dsanson avatar Mar 16 '20 02:03 dsanson

https://github.com/kovidgoyal/kitty/issues/2449

kovidgoyal avatar Apr 17 '20 02:04 kovidgoyal

(when) is this fix going to end up in the public kitty version (I am not familiar with the kitty release cycle and development process but given that it was committed already 30 days ago and there was a release in between I wonder).

Thanks @kovidgoyal for referring to the other issue and or fixing the issue!

andreas-bulling avatar Apr 17 '20 05:04 andreas-bulling

It was released a while ago.

kovidgoyal avatar Apr 17 '20 05:04 kovidgoyal

in which release version?

andreas-bulling avatar Apr 17 '20 06:04 andreas-bulling

You click on a commit in github and it will tell you which release it first appeared in.

kovidgoyal avatar Apr 17 '20 06:04 kovidgoyal

I am using 0.17.2 but the problem is still there

andreas-bulling avatar Apr 17 '20 07:04 andreas-bulling

Then its not the same issue.

kovidgoyal avatar Apr 17 '20 07:04 kovidgoyal

Not fixed for me I am afraid

andreas-bulling avatar May 26 '20 04:05 andreas-bulling

it's working for me with kitty 0.17.3 (both dark and light background) thanks

jaeheum avatar May 27 '20 16:05 jaeheum

@andreas-bulling I wonder if you are having a different problem, given that both this solution and the "view metadata before quitting" trick didn't work for you. Is your problem exactly as described by @jaeheum? After quitting termpdf, when you launch vim, you get an unmovable black box as residue, where the image once was?

dsanson avatar May 27 '20 23:05 dsanson

I am having the black box problem when using termpdf.py with neomutt: After opening an attachment in the console a black box is left that I can only get rid of by quitting kitty.

andreas-bulling avatar May 28 '20 04:05 andreas-bulling

the problem is back with kitty 0.17.4.

jaeheum avatar Jun 20 '20 23:06 jaeheum

I do not have the issue in kitty 0.17.4, but I am not using neomutt. Can you try a few things to help narrow down the possible causes?

First, try:

> kitty +kitten diff img1.jpg img2.jpg
> vim

This is from the original bug report at kovidgoyal/kitty#2449. If that is still causing problems for you, then you should reopen that issue.

If that works fine, then maybe it has to do with the way that termpdf.py is closed after having been launched from neomutt. Does the problem arise when you just run termpdf.py directly, and not from neomutt?

dsanson avatar Jun 22 '20 00:06 dsanson

@dsanson I tried the two-liner and I don't have any problem with the black box in this case. Also running termpdf.py directly doesn't cause and problem, i.e. it seems to be linked to neomutt.

andreas-bulling avatar Jun 22 '20 05:06 andreas-bulling

@dsanson I am not using neomutt either. My usage is just termpdf.py file.pdf. As your kitty is behaving nicely, I'll have to debug mine more carefully. (There are other factors complicating the matter: on another machine with almost identical setup termpdf.py runs into fish vs screen size.) I will try to do more investigation later in the week.

jaeheum avatar Jun 22 '20 16:06 jaeheum

The fish/kitty screen size problem is resolved: fish-shell/fish-shell/issues/6994. But it hasn't made it into release yet, so you have to build from source.

dsanson avatar Jun 22 '20 17:06 dsanson

I wonder, though, what the starting point is to figure out what's going on. Do you think I should file a bug report with neomutt or can you help with this?

andreas-bulling avatar Jun 23 '20 06:06 andreas-bulling

With a few (but not all) pdf files I can reproduce the black residue problem. However I can workaround the problem by running the kitty window in full-screen mode in a monitor with portrait mode. Fortunately that's my preferred way of running kitty and termpdf.py :-)

fish 3.0.2 termpdf.py 0.1.1 kitty 0.17.4

That kitty vs fish problem was happening for another installation with fish 3.1.2 and I'll wait for fish 3.2. Thanks.

jaeheum avatar Jun 26 '20 23:06 jaeheum