fish version: 2.5.0
Ubuntu 16.04 Linux limebox 4.4.0-78-generic #99-Ubuntu SMP Thu Apr 27 15:29:09 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Hello, I can't seem to be able to run fish scripts, when I create an executable file echo "echo test" > script.fish
, running fish ./script.fish
results in an error message: ./script.fish: No such file or directory
.
It works fine with sh -c 'env HOME=$(mktemp -d) fish'
, for some reason.
link/.config/fish $ tree
.
βββ completions
βΒ Β βββ fisher.fish
βΒ Β βββ get.fish -> /home/limeth/.config/fisherman/get/completions/get.fish
βΒ Β βββ git.fish -> /home/limeth/.config/fisherman/git-flow/completions/git.fish
βββ conf.d
βΒ Β βββ git-flow.init.fish -> /home/limeth/.config/fisherman/git-flow/init.fish
βββ config.fish
βββ fish_colors
βββ fishd.limebox
βββ fishfile
βββ fish_history
βββ fish_read_history
βββ functions
βββ cl.fish
βββ fisher.fish
βββ fish_greeting.fish -> /home/limeth/.config/fisherman/bobthefish/fish_greeting.fish
βββ fish_mode_prompt.fish -> /home/limeth/.config/fisherman/bobthefish/fish_mode_prompt.fish
βββ fish_prompt.fish -> /home/limeth/.config/fisherman/bobthefish/fish_prompt.fish
βββ fish_right_prompt.fish -> /home/limeth/.config/fisherman/bobthefish/fish_right_prompt.fish
βββ fish_title.fish -> /home/limeth/.config/fisherman/bobthefish/fish_title.fish
βββ fish_user_key_bindings.fish
βββ fzf_key_bindings.fish -> /home/limeth/.fzf/shell/key-bindings.fish
βββ get.fish -> /home/limeth/.config/fisherman/get/functions/get.fish
βββ getopts.fish -> /home/limeth/.config/fisherman/getopts/getopts.fish
βββ set_color_custom.fish -> /home/limeth/.config/fisherman/jellyfish/functions/set_color_custom.fish
3 directories, 22 files
$ cat config.fish
# Source dotfiles scripts
source ~/.dotfiles/bin/source.fish
# Enable terminal colors
set -x TERM "xterm-256color"
# Vi mode
# Automatically enable Vi mode in `~/.config/fish/functions/fish_user_key_bindings.fish`
set -g theme_display_vi yes
Link to ~/.dotfiles/bin/source.fish
: https://gitlab.com/Limeth/dotfiles/blob/master/bin/source.fish
Any tips on what I should be looking for are appreciated.
running fish ./script.fish results in an error message: ./script.fish: No such file or directory.
This looks like something cd
s in your configuration.
Please try to run that file, and when it fails, run echo $PWD; fish -c 'echo $PWD'
. If the two differ, that's your problem.
That was it!
$ echo $PWD
/tmp
$ fish -c "echo \$PWD"
/home/limeth
Thank you very much! :)
Right, your source.fish ends with cd ~
. That's generally a bad idea. A login shell should already have PWD set to your home directory. And if you're starting any other fish instance you do not want to change the PWD. If you feel there is some good reason to do that you should limit it to interactive shells:
if status is-interactive
cd ~
end
Most helpful comment
Right, your source.fish ends with
cd ~
. That's generally a bad idea. A login shell should already have PWD set to your home directory. And if you're starting any other fish instance you do not want to change the PWD. If you feel there is some good reason to do that you should limit it to interactive shells: