ish-app / ish

Linux shell for iOS
https://ish.app
Other
16.34k stars 856 forks source link

Always allow prompted but not remembered. #2296

Open hulleyrob opened 7 months ago

hulleyrob commented 7 months ago

When trying to render images a box comes up to ask whether to allow inline images.

This works fine but always allow is only remembered for that session.

Can this be remembered somewhere to actually always allow?

lewhfree commented 3 months ago

Could you please add more information about the issue? What inline images? Is the popup in ish or ios? How do I recreate the issue?

hulleyrob commented 3 months ago

I believe its an ish popup

IMG_9085

I did this with a shell script that uses imgcat like in this link I just found that might explain it better than I can: https://www.lets-talk-about.tech/2018/03/display-images-in-line-with-terminal.html

If I click always allow it works for the rest of the session whereas I was expecting it not to ask again as it is behaving like I expected allow this session to behave.

If you need any more info just let me know.

Thanks Rob

hulleyrob commented 3 months ago

I missed out the part where I'm sshd onto another computer that has imgcat installed.

So I ssh onto my iMac and then as per this screenshot (the command had also gone in the previous one)

image

uwe-schwarz commented 1 month ago

I have the same issue, this is iTerm2‘s extension to display inline images: https://iterm2.com/documentation-images.html. Using imgcat (https://iterm2.com/utilities/imgcat) it can be easily reproduced:

ssh somewhere
imgcat /tmp/image.png
# dialog displays, click on always
imgcat /tmp/image.png
# image gets displayed
# close session
# restart again
ssh somewhere
imgcat /tmp/image.png
# dialog gets displayed again

I couldn‘t get imgcat working directly in iSH, but that‘s just because I never needed it so far.

uwe-schwarz commented 1 month ago

So, I finally reduced it to a few lines and it‘s working directly in iSH. Needs curl and base64:

dog64="$(curl -s https://placedog.net/300x300 | base64 -w0)"
dog_size="$(echo "$dog64" | base64 -d | wc -c)"
printf "\033]1337;File=inline=1;size=%d:%s\a\n" "$dog_size" "$dog64"
uwe-schwarz commented 1 month ago

I‘m unsure if this is correct, but my guess would be, that there needs to be the following in app/terminal/term.js:

term.getPrefs().set('allow-images-inline', 'true');

The variable is a „tristate“ and I don‘t know how to set them correctly. And I don‘t have anything else besides my iPad at the moment, so I can‘t test it locally (and I‘ve never done it).