Clarification needed regarding d=i and d=I and keeping images in memory when they are hidden. #8129
-
I need some clarification how to keep hidden images in memory while deleting others? Is this possible? As a simple example. If I have two images. I show the first one. And then I hide it with I add a second one. And then I hide it with If the first image is hidden while I delete the other one with In the example below, at step 6 and step 7, I need some clarification. If I omit step 6 (and keep image 1 visible), then when deleting image 2 (in step 7) it does not affect image 1. img_1=$(printf "/home/vurentjie/Downloads/test1.png" | base64)
img_2=$(printf "/home/vurentjie/Downloads/test2.png" | base64)
# Step 1: transmit and store img with i=1
printf '\e_Gt=f,q=2,f=100,a=t,i=1;'$img_1'\e\\'
# Step 2: show image i=1 and p=2
printf '\e[?2026h'
printf '\e[s'
printf '\e[1;1H'
printf '\e_Gi=1,C=1,a=p,z=1,c=4,r=4,p=2,q=2;\e\\'
printf '\e[u'
printf '\e[?2026l'
# Step 3: remove image with i=1 (without free d=i)
printf '\e_Gq=2,i=1,d=i,a=d;\e\\'
# Step 4: show image i=1 and p=2 again (no need to retransmit)
# At this point this works as I expect it would because d=i
printf '\e[?2026h'
printf '\e[s'
printf '\e[1;1H'
printf '\e_Gi=1,p=2,a=p,z=1,r=4,C=1,q=2;\e\\'
printf '\e[u'
printf '\e[?2026l'
# Add the second image
# Step 5: transmit and store img with i=2
printf '\e_Gt=f,q=2,f=100,a=t,i=2;'$img_2'\e\\'
# Step 6: hide the image with i=1 (without free d=i) ... note this is "Step 3" again, and I would expect "Step 8" to work again
printf '\e_Gq=2,i=1,d=i,a=d;\e\\'
# Step 7: now remove image with i=2 (but with free d=I)
# Somehow this also removes i=1 because it was hidden in "Step 6"
printf '\e_Gq=2,i=2,d=I,a=d;\e\\'
# Step 8: try show image i=1 and p=2 again
# This does not work, if both "Step 6 and Step 7" are also run
printf '\e[?2026h'
printf '\e[s'
printf '\e[1;1H'
printf '\e_Gi=1,p=2,a=p,z=1,r=4,C=1,q=2;\e\\'
printf '\e[u'
printf '\e[?2026l'
Am I missing anything obvious here? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi @kovidgoyal Thanks for fixing the other issue. I know I marked this thread as answered already, but I have another query. I am trying to understand how to free up storage manually. Is it correct to assume?
Again with a simplified example: I transmit a single image, and then I remove it with d=I. Example: img_1=$(printf "/home/vurentjie/Downloads/test1.png" | base64 -w0)
# Transmit and store img with i=1
printf '\e_Gt=f,q=2,f=100,a=t,i=1;'$img_1'\e\\'
# Remove and free the img with i=1
printf '\e_Gq=2,i=1,d=I,a=d;\e\\' I was adding a few logs in kitty/graphics.c to check the value of I am not sure if it is meant to change, if I am misunderstanding anything. I noticed that in Line 1907 in 5994a0b My logs showed me the following:
|
Beta Was this translation helpful? Give feedback.
8facaf4