dsanson / termpdf

barebones graphical pdf/djvu/cbr/image viewer that works inside iTerm2 2.9+ and Kitty
MIT License
637 stars 24 forks source link

After opening a file, I can not do anything #2

Closed zhmiao closed 8 years ago

zhmiao commented 8 years ago

it shows error:

screen shot 2016-02-12 at 6 19 35 pm

and goes back to bash, which I don't use. I use zsh.

What is going on?

AhmedAA commented 8 years ago

Technically, you can. Problem is, the entire program is written in bash, and there are no failsafes. If you press a button that isn't caught, it just crashes :D

If you open a simple pdf (only text), and press "enter" to go forward, then it works without any problems. I.e. termpdf /path/to/pdf

Worked fine for me.

I am a big fan of this, it just needs to be written in a proper language, with proper failsafes.

dsanson commented 8 years ago

Agree 100% AhmedAA.

dsanson commented 8 years ago

If you are on OS X using iTerm, you might try the new version. I've removed the dependency on Bash 4.x, so it should now work on Bash 3.2. If you want support for marks, you'll still need to install Bash 4.x: brew install bash.

zhmiao commented 8 years ago

Thank you so much! Now it is really cool. I have a question. I opened the pdf file, the white part is not shown. you can see from the picture:

screen shot 2016-03-25 at 10 26 23 am

the pdf background has the same color with the terminal background, which I don't know why

dsanson commented 8 years ago

Yep. Some PDF files have transparent backgrounds, and some don't. The previous version was converting everything into PNG, and took the opportunity to "flatten" all the images---i.e., add white backgrounds. The current version is displaying each page of the PDF without converting to PNG. This is a side-effect.

The work-around is to use a light colored theme: then it is kinda cool that the background color matches your theme, when it happens.

The solution would be to find a tool, or a setting on the tools I'm already using, that adds the white background.

zhmiao commented 8 years ago

great! what tool can be used to set the background? or is there a command in the terminal that can change the theme to background? so I can do termpdf xx.pdf && change background ? Since all my console applications are based on a dark color theme, to change time all would be pain.

dsanson commented 8 years ago

iTerm: Preferences --> Profiles --> Colors

zhmiao commented 8 years ago

Yes. I though you were saying that there is some tools can be used to set background temporally.

dsanson commented 8 years ago

That would be neat. I just tried tmux select-pane -P 'bg=white', which temporarily changes the background of the current pane to white. But for reasons I don't understand, that background color fails to show through, so it doesn't fix the problem.

dsanson commented 8 years ago

I started a new issue on the transparency problem. I do have some functions and aliases that make switching between dark and light themes easier, which I posted there.