[linux/fish-shell] Red either fails or runs depending on the way it is called
xaduha opened this issue · comments
one@voidlinux ~> pwd
/home/one
one@voidlinux ~> which red
/usr/bin/red
one@voidlinux ~> red
PROGRAM ERROR: Invalid encapsulated data.
one@voidlinux ~> /usr/bin/red
--== Red 0.5.4 ==--
Type HELP for starting information.
red>>
I'm using fish-shell, so it probably has something to do with the environment. Still, something is fishy.
one@voidlinux ~> env | sort > env1.txt
one@voidlinux ~> bash
[one@voidlinux ~]$ env | sort > env2.txt
[one@voidlinux ~]$ diff env*
16c16
< SHLVL=2
---
> SHLVL=3
22a23
> _=/usr/bin/env
Bottomline, works under bash, doesn't work under fish when called without specifying the absolute path.
Doesn't happen with red-054
or the automated build that I previously used, commit 7526673.
EDIT: Having a red binary in a current folder allows it to launch normally, red
and ./red
both.
I don't know if it's in any way helpful, but other errors I had with this
bash-4.3# red -d
*** Driver Internal Error: Access Error : Bad file path: //.red/
*** Where: throw-on-error
*** Near: [make-dir temp-dir]
and
# red -d
** Script Error: Invalid compressed data - problem: -3
** Near: script: decapsulate
if none? script
I just got this issue on macOS with the fish shell. Should I reopen it?
@spinningarrow Have you looked at the linked issue #543 ?
Yes, I did. That one is closed too and I couldn't really find a proper resolution for it (other than creating an alias to red, if I understood correctly). What I'm trying to say is - is this something red can fix from its side; or failing that, provide an error message to the user when it's started incorrectly what the workaround is?
I'm also not sure why it works fine with bash but not with fish - what's the difference in the way the binary is invoked?
I'm also not sure why it works fine with bash but not with fish - what's the difference in the way the binary is invoked?
I also wonder about it?
For now, I solved the issue, by having Red executable in my PATH
and creating fish function ~/.config/fish/functions/red.fish
with the following content:
function red
~/bin/red-063 $argv
end