gokcehan/lf

on-redraw not being called on terminal resize

Closed this issue · 3 comments

I am running kitty on NixOS. I have on-redraw configured to change 'ratios' depending on terminal width. When I resize the terminal, the ratios do not change automatically. If I manually run ":on-redraw", then the ratios properly get set.

What version of lf are you running, and can you provide a minimal config file?

Also does something like the following work?

# move the cursor down as a test
cmd on-redraw down

version: r31

`
set cleaner "ctpvclear"
set dircounts
set hidden
set ifs "
"
set info "size:time"
set period 1
set previewer "ctpv"
set ratios "1:2:3"
set scrolloff 5
set shell "bash"
set shellopts "-eu"

cmd extract %{{
set -f
case $f in
.tar.bz|.tar.bz2|.tbz|.tbz2) tar xjvf $f;;
.tar.gz|.tgz) tar xzvf $f;;
.tar.xz|.txz) tar xJvf $f;;
*.zip) unzip $f;;
*.rar) unrar x $f;;
*.7z) 7z x $f;;
esac
}}
cmd mkdir %{{
printf "Directory name: "
read ans
mkdir $ans
}}
cmd mkfile %{{
printf "File name: "
read ans
kitty -e kak $ans
}}
cmd on-redraw %{{
down
}}
cmd trash %{{
trash-put $fx
}}
cmd zip %{{
set -f
mkdir $1
cp -r $fx $1
zip -r $1.zip $1
rm -rf $1
}}

map . set hidden!
map shell
map DD trash
map O $mimeopen --ask $f
map X !$f
map gd cd /mnt/media/downloads
map gm cd /mnt/media/movies/theatrical
map gs cd /mnt/media/tv/shows
map m
map md mkdir
map mf mkfile
map o &mimeopen $f
map p : paste; clear
map x $$f
`
'cmd on-redraw down' did not work

Thanks.

So the on-redraw hook was added after version r31 was released. It should be made available from version r32 onwards (hopefully coming soon), see #1427 for more details.