skim icon indicating copy to clipboard operation
skim copied to clipboard

Preview fails to spawn command

Open hajdamak opened this issue 4 years ago • 6 comments

Calling: ls | sk --preview '/bin/echo' results in error message displayed in preview window: Failed to spawn: /bin/echo / No such file or directory (os error 2) Skim version 0.6.9 Ubuntu 16.04.06 LTS

hajdamak avatar Sep 25 '19 12:09 hajdamak

@hajdamak could you please run the command with ${SHELL:-sh} -c '/bin/echo' in your shell and check what happens? Internally skim will invoke this command.

lotabout avatar Sep 25 '19 14:09 lotabout

In Fish I get:

fish: ${ is not a valid variable in fish.
${SHELL:-sh} -c '/bin/echo'
 ^

In Bash it just prints empty line. Note however that I get failed to spawn message in both Fish and Bash

hajdamak avatar Sep 25 '19 15:09 hajdamak

I have now tried on Fedora 30 and everything works fine.

hajdamak avatar Sep 25 '19 19:09 hajdamak

@hajdamak Could you please try using echo instead of /bin/echo and see if there is a difference?

lotabout avatar Sep 25 '19 23:09 lotabout

Same problem on Ubuntu.

hajdamak avatar Sep 26 '19 07:09 hajdamak

The fact that you are missing /bin/echo is odd. What happens if you run [ -x /bin/echo ] && echo exists || echo does not exist in the terminal?

Other than that, I do believe you need to use {} in the command string to be able to see something.

ls | sk --preview '/bin/echo {}'

Try without the /bin/ as well?

ls | sk --preview 'echo {}'

victorz avatar Nov 10 '22 12:11 victorz