termpdf.py
termpdf.py copied to clipboard
reset terminal on exit
$ 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.
hittng M to draw a metadata box before exiting helps (no residue)
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.
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.
No, no progress. And yes, it is annoying.
https://github.com/kovidgoyal/kitty/issues/2449
(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!
It was released a while ago.
in which release version?
You click on a commit in github and it will tell you which release it first appeared in.
I am using 0.17.2 but the problem is still there
Then its not the same issue.
Not fixed for me I am afraid
it's working for me with kitty 0.17.3 (both dark and light background) thanks
@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?
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.
the problem is back with kitty 0.17.4.
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 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.
@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.
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.
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?
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.