Comments (12)
Ah just got through the compilation - yupp works with the -pi
switch - Thanks alot ❤️ .
from timg.
FYI, this is part of the v1.5.3 release.
That also includes some more detection in the VSCode context, so it automatically switches to iterm graphics in vscode, and also can extract the width and height of a character cell to be able to show animations and columnized output.
from timg.
Yep, the ioctl()
first, then fallback query is now exactly how I do it
from timg.
Should be easy to add, we have the png_size
value available right there to include in the sprintf().
The images worked in the tested iterm2, wezterm and konsole terminal; if you have a terminal where you observed this to be not working, it might be useful to add that to the set of terminals to test with.
from timg.
just tested with sending bogus values to konsole and wezterm and it seems to work fine, i.e. they don't look at that value.
I don't have an iterm2 to test as it is not available on linux. The value is ambiguous: does it mean the raw size or the base64 encoded size ?
from timg.
Yeah the parameter is a bit unclear - since it says "file size in bytes" I'd assume it means the real file size, not the size of the base64-encoded content.
Btw vscode's integrated terminal checks against this value to spot data errors and to limit the sequence size. I find it kinda weird that other terminals just let things pass here, smells like an potential DOS vector to me.
from timg.
so I can test it with vscode ? What do I need to do to reproduce ?
from timg.
You'd need vscode 1.80+ version (got recently added), and make sure, that the terminal image support is enabled (it is by default). Then imgcat
(https://iterm2.com/utilities/imgcat) should show images via IIP.
To repro - if you omit the size param in the sequence, images will not show up.
from timg.
Alright, looks like it is the raw image size. Can you do a git pull and test again ?
I tested it the change with vscode terminal.
from timg.
A quick one-liner I guess 😸
one sec...
from timg.
Here is an AppImage to avoid compiling from scratch.
from timg.
Sidenote on size ioctls like TIOCGWINSZ:
Its indeed not safe to assume, that the OS implements the pixel notion in its tty/termios abstraction - it is not specced on POSIX side (there a ~5ys old attempt to add that). ConPty/Windows does not implement it (which is partially the reason why vscode terminal relies on those old DEC size sequences). Still all major remaining unix derivates implement the pixel stuff as far as I am aware (at least on Linux/FreeBSD/MacOS/Solaris, no clue about AIX here).
Next obstacle to consider are different ssh libs and whether they transmit these ioctl datapoints (idk, have not checked it).
All in all - the size sequences are a safer bet, although a bit more cumbersome to work with on cmdline appside due the needed message cycling. For best TE+OS coverage prolly check for ioctl first and use the CSI t sequences as a fallback.
from timg.
Related Issues (20)
- carbonyl love?
- Images rendered blurry in fzf preview. HOT 2
- new version not have binary file HOT 7
- No package 'libdeflate' found HOT 2
- ipv4 vs. ipv6 HOT 5
- libsixel is not available on Fedora 38 HOT 2
- Image preview in `lf` HOT 1
- Detected Crash: AddressSanitizer: heap-buffer-overflow HOT 7
- Image viewer with scrolling HOT 3
- Detected memory leaks on timg
- Auto detect for Ghostty doesn't work HOT 8
- Cannot display certain SVG files HOT 6
- can we convert a whole video? HOT 2
- tmux passthrough for other terminals HOT 3
- Cannot read pdf in alpine container HOT 10
- Opensllde Error HOT 5
- Sixel support in foot does not get recongnized correctly HOT 8
- Feature request: support sixel format HOT 2
- Displaying long images starting from the top instead of the bottom HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from timg.