gokcehan / lf

Terminal file manager
MIT License
7.57k stars 322 forks source link

"a=d,d=A" after closing lf #1189

Open ignamartinoli opened 1 year ago

ignamartinoli commented 1 year ago

Sometimes, after closing lf or when I take input for deleting a file. I see printed on the terminal the line a=d,d=A.

I have no idea why.

This is my configuration file

set shell sh
set shellopts '-eu'
set ifs "\n"
set icons
set mouse

set scrolloff 10
set drawbox

set ignorecase true

set previewer ~/.config/lf/preview.sh
set cleaner ~/.config/lf/clean.sh

cmd rename %if [ -e "$1" ]; then printf "file exists"; else mv "$f" "$1"; fi

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 tar ${{
    set -f
    mkdir "$1"
    cp -r "$fx" "$1"
    tar czf "$1.tar.gz" "$1"
    rm -rf "$1"
}}

cmd zip ${{
    set -f
    mkdir "$1"
    cp -r "$fx" "$1"
    zip -r "$1.zip" "$1"
    rm -rf "$1"
}}

map . set hidden!
map <enter> $~/.config/lf/open.sh $f
map a push $touch<space>
map r push $~/.config/lf/rename.sh<space>
map <backspace2> $~/.config/lf/delete.sh
map d $~/.config/lf/delete.sh
map <c-f> $~/.config/lf/fzf.sh
slavistan commented 1 year ago

a=d,d=A looks like part of a terminal escape sequence for the kitty graphics protocol. Presumably, a script you run when exiting lf is the cause of that.

ignamartinoli commented 1 year ago

In theory, a=d is the icat command to delete images.

My clean.sh is

#!/bin/sh

kitten icat --clear --stdin no --silent --transfer-mode file < /dev/null > /dev/tty

and the last line of my previewer has a exit 1 to make sure it is exited.

I don't get why I should see an icat command in the terminal

rockyzhang24 commented 1 year ago

@ignamartinoli Same issue. Do you think if we should report this to kitty?

ignamartinoli commented 1 year ago

@rockyzhang24 I'm not sure if this is a Kitty or an lf issue.

It wouldn't hurt tho, could you please do it and mention this issue so that they get linked.

Maybe this way we can have a second opinion and see were this bug report should be worked on.

rockyzhang24 commented 1 year ago

@ignamartinoli Sure. I'll do that.