termux / termux-app

Termux - a terminal emulator application for Android OS extendible by variety of packages.
https://f-droid.org/en/packages/com.termux
Other
32.92k stars 3.48k forks source link

[Feature]: Support for CSI 14 #3002

Open microo8 opened 1 year ago

microo8 commented 1 year ago

Feature description

CSI 14 is an escape code, that returns the screen size in pixels.

This feature would allow the running application to get the screen size, it is used mainly in sixel supporting apps, that need to scale the image before printing it out. This would be needed if this #2973 would me merged.

Another alternative is TIOCGWINSZ syscall.

Additional information

alacritty suports it:

https://github.com/alacritty/alacritty/commit/cdf5e51e742d67d1b96940a5096210725a1e51e8

MatanZ commented 1 year ago

CSI 14 t and CSI 16 t are included in #2973.

bropines commented 1 year ago

I think I have a similar request, but I don't know anything about it at all. Here's from that discussion. https://github.com/hzeller/timg/issues/86

MatanZ commented 1 year ago

Can you elaborate on "not working"? It works in my testing:

[18:47:50:~]$ echo -e '\033[14t' ; cat

^[[4;1161;1056t

[18:48:22:~]$ echo -e '\033[16t' ; cat

^[[6;43;22t

[18:48:30:~]$

And also in a program I wrote that utilizes this escape sequence.