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

feature request: change, simplify joshuto image preview #516

Open
iambumblehead opened this issue Mar 22, 2024 · 2 comments
Open

feature request: change, simplify joshuto image preview #516

iambumblehead opened this issue Mar 22, 2024 · 2 comments

Comments

@iambumblehead
Copy link

iambumblehead commented Mar 22, 2024

Mainly, preview setup is too complicated. It requires wrapper scripts and extra documentation. The "preview_*" hooks are insufficient to call other applications and scripts in varied ways they require.

Its useful to compare joshuto with vifm. I wrote an image preview script that is easily used with vifm, whereas I failed to get any sort of "hello world" preview from any tool working with joshuto. Vifm is proof; image preview can be simple for curses apps.


The details,

Wrapper scripts should not be used. They increase complexity and chance of bugs, require documentation and explanation, etc. Joshuto should provide a means for calling external scripts with no wrapper.

Preview hooks are insufficient,

The “shown” script gets the path of the file being previewed as first argument and then the x and y coordinate and the width a height of the preview area as second to fifth parameters.

It would be an improvement if joshuto would call, within reason, any script using any call signature or extra options. Vifm allows preview behaviour to call (for example) thu.sh -ck %c %pw %ph %pd, where %c and %pw will resolve to "current file" and "preview width" https://vifm.info/manual.shtml#Command%20macros Joshuto users currently must write wrapper scripts to simulate this behaviour that would be nice to have in Joshuto rather than userland.

Expose a hook or a way to call external scripts before ncurses is started. A wrapper script is not a good solution for this, as it adds complexity to userland. The hook would be useful for bash scripts like thu.sh because, when ncurses runs, stdout cannot be used by child scripts to query the terminal for things like sixel features and cell resolution. This hook would allow bash scripts to query stdout beforehand.

Thank you for reading me.

Related links,

@donovanglover
Copy link
Contributor

I had a working preview script but it broke with the recent 0.9.8 update. I've since switched to yazi which has everything built-in.

@iambumblehead
Copy link
Author

your nixos repo is looking very rad @donovanglover 👍 :)

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