skim icon indicating copy to clipboard operation
skim copied to clipboard

Preview does not work properly on sk 0.9.4 with fish 3.2.1

Open TakaakiFuruse opened this issue 4 years ago • 4 comments

bug

As shown on the gif, the Preview function does not work properly on fish 3.2.1. I realized after I upgraded to 3.2.1 from 3.2.0.

Once I removed preview, sk --ansi -i -c 'ag --color "{}"' it started working properly. I am totally unsure what is going on, but I am happy to take a look at the issue.

TakaakiFuruse avatar Mar 19 '21 22:03 TakaakiFuruse

I've been facing a similar issue:

exec bash
sk --ansi -i -c 'rg -l "{}"' --preview "cat {+}"

sk-bug

RyanGreenup avatar Apr 16 '21 02:04 RyanGreenup

This is how I am able to reproduce this on my system:

#!/bin/bash
cd "$(mktemp -d)"

# Get some text files
curl "https://en.wikipedia.org/wiki/Main_Page" > 1.txt
curl "https://en.wikipedia.org/wiki/Kastner"   > 2.txt
curl "https://en.wikipedia.org/wiki/Peyavin"   > 4.txt
curl "https://en.wikipedia.org/wiki/WLML-FM"   > 3.txt
curl "https://en.wikipedia.org/wiki/GB-4"      > 5.txt
curl "https://en.wikipedia.org/wiki/Being"     > 6.txt
curl "https://en.wikipedia.org/wiki/Uleiota"   > 7.txt
curl "https://en.wikipedia.org/wiki/C3orf70"   > 8.txt


# Get v0.6.3 (an aribtrarily old version that works)
wget https://github.com/lotabout/skim/releases/download/v0.6.3/skim-v0.6.3-x86_64-unknown-linux-gnu.tar.gz
tar -xzf skim-v0.6.3-x86_64-unknown-linux-gnu.tar.gz
rm skim-v0.6.3-x86_64-unknown-linux-gnu.tar.gz
mv sk sk_063

# Get v0.9.4 
wget https://github.com/lotabout/skim/releases/download/v0.9.4/skim-v0.9.4-x86_64-unknown-linux-musl.tar.gz
tar -xzf skim-v0.9.4-x86_64-unknown-linux-musl.tar.gz
rm skim-v0.9.4-x86_64-unknown-linux-musl.tar.gz
mv sk sk_094


# Test v0.6.3 (working)
./sk_063 --ansi -i -c 'rg -t txt -l {}' --preview "cat {} | head -n 100"

# Test v0.9.4 (Not working!)
./sk_094 --ansi -i -c 'rg -t txt -l {}' --preview "cat {} | head -n 100"

if it's relevant, this was on bash 5.1.4.

edit: After playing with it for a while, it seems that the issue is that the --preview is incompatible with the command mode -c, which is really unfortunate because this was really useful for searching through documents.

RyanGreenup avatar Apr 16 '21 12:04 RyanGreenup

So I fixed this by piping the output of find into skim, then the command mode and preview would work together, in the absence of piping those into sk the would not work together, I could either have a preview (just cat) or I could use the command mode.

Regardless, piping find into skim fixes this for me.

RyanGreenup avatar Apr 24 '21 12:04 RyanGreenup

Preview with command seems to be working for me again in version 3.3.1

fussybeaver avatar Nov 12 '21 14:11 fussybeaver