Errors on setup when using eval within fish
IanVaughan opened this issue · comments
Ian Vaughan commented
Not sure if this related to #40 :
$ eval (tmuxifier init -)
fish: Unknown command 'export'
- (line 1): begin; export TMUXIFIER="/Users/ian/.tmuxifier"; source "$TMUXIFIER/init.sh";
^
in . (source) call of file '-',
called on standard input,
source: Error encountered while sourcing file '/init.sh':
source: No such file or directory
And when it's added to the ~/.config/fish/config.fish
I get the following output on every new fish shell :
- (line 1): begin; export TMUXIFIER="/Users/ian/.tmuxifier"; source "$TMUXIFIER/init.sh";
^
in . (source) call of file '-',
called on line 34 of file '/Users/ian/.config/fish/config.fish',
in . (source) call of file '/Users/ian/.config/fish/config.fish',
called on standard input,
fish: The '$' character begins a variable name. The character '{', which directly followed a '$', is not allowed as a part of a variable name, and variable names may not be zero characters long. To learn more about variable expansion in fish, type 'help expand-variable'.
/Users/ian/.tmuxifier/init.sh (line 2): if [ -z "${TMUXIFIER}" ]; then
^
in . (source) call of file '/Users/ian/.tmuxifier/init.sh',
called on line 1 of file '-',
in . (source) call of file '-',
called on line 34 of file '/Users/ian/.config/fish/config.fish',
in . (source) call of file '/Users/ian/.config/fish/config.fish',
called on standard input,
fish: The '$' character begins a variable name. The character '{', which directly followed a '$', is not allowed as a part of a variable name, and variable names may not be zero characters long. To learn more about variable expansion in fish, type 'help expand-variable'.
/Users/ian/.tmuxifier/init.sh (line 3): export TMUXIFIER="${HOME}/.tmuxifier"
^
in . (source) call of file '/Users/ian/.tmuxifier/init.sh',
called on line 1 of file '-',
in . (source) call of file '-',
called on line 34 of file '/Users/ian/.config/fish/config.fish',
in . (source) call of file '/Users/ian/.config/fish/config.fish',
called on standard input,
fish: The '$' character begins a variable name. The character '{', which directly followed a '$', is not allowed as a part of a variable name, and variable names may not be zero characters long. To learn more about variable expansion in fish, type 'help expand-variable'.
/Users/ian/.tmuxifier/init.sh (line 5): export TMUXIFIER="${TMUXIFIER%/}"
^
in . (source) call of file '/Users/ian/.tmuxifier/init.sh',
called on line 1 of file '-',
in . (source) call of file '-',
called on line 34 of file '/Users/ian/.config/fish/config.fish',
in . (source) call of file '/Users/ian/.config/fish/config.fish',
called on standard input,
fish: Illegal command name '[[ ":$PATH:" != *":$TMUXIFIER/bin:"* ]]'
/Users/ian/.tmuxifier/init.sh (line 9): if [[ ":$PATH:" != *":$TMUXIFIER/bin:"* ]]; then
^
in . (source) call of file '/Users/ian/.tmuxifier/init.sh',
called on line 1 of file '-',
in . (source) call of file '-',
called on line 34 of file '/Users/ian/.config/fish/config.fish',
in . (source) call of file '/Users/ian/.config/fish/config.fish',
called on standard input,
fish: The '$' character begins a variable name. The character '(', which directly followed a '$', is not allowed as a part of a variable name, and variable names may not be zero characters long. To learn more about variable expansion in fish, type 'help expand-variable'.
/Users/ian/.tmuxifier/init.sh (line 15): if [ -n "$(command -v "tmuxifier")" ] && [ -z "$TMUXIFIER_NO_COMPLETE" ]; then
^
in . (source) call of file '/Users/ian/.tmuxifier/init.sh',
called on line 1 of file '-',
in . (source) call of file '-',
called on line 34 of file '/Users/ian/.config/fish/config.fish',
in . (source) call of file '/Users/ian/.config/fish/config.fish',
called on standard input,
fish: Expected a command name, got token of type 'Run job in background'. Did you mean 'COMMAND; and COMMAND'? See the help section for the 'and' builtin command by typing 'help and'.
/Users/ian/.tmuxifier/init.sh (line 15): if [ -n "$(command -v "tmuxifier")" ] && [ -z "$TMUXIFIER_NO_COMPLETE" ]; then
^
in . (source) call of file '/Users/ian/.tmuxifier/init.sh',
called on line 1 of file '-',
in . (source) call of file '-',
called on line 34 of file '/Users/ian/.config/fish/config.fish',
in . (source) call of file '/Users/ian/.config/fish/config.fish',
called on standard input,
fish: Could not locate end of block. The 'end' command is missing, misspelled or a ';' is missing.
/Users/ian/.tmuxifier/init.sh (line 16): if [ -n "$BASH_VERSION" ]; then
^
in . (source) call of file '/Users/ian/.tmuxifier/init.sh',
called on line 1 of file '-',
in . (source) call of file '-',
called on line 34 of file '/Users/ian/.config/fish/config.fish',
in . (source) call of file '/Users/ian/.config/fish/config.fish',
called on standard input,
if - if - conditionally execute a command
if - conditionally execute a command
Synopsis
if CONDITION; COMMANDS_TRUE...; [else if CONDITION2;
COMMANDS_TRUE2...;] [else; COMMANDS_FALSE...;] end
Description
if will execute the command CONDITION. If the condition's exit status
is 0, the commands COMMANDS_TRUE will execute. If the exit status is
not 0 and else is given, COMMANDS_FALSE will be executed.
In order to use the exit status of multiple commands as the condition
of an if block, use begin; ...; end and the short circuit commands and
and or.
The exit status of the last foreground command to exit can always be
accessed using the $status variable.
Example
if test -f foo.txt
echo foo.txt exists
else if test -f bar.txt
echo bar.txt exists
else
echo foo.txt and bar.txt do not exist
end
will print foo.txt exists if the file foo.txt exists and is a regular
file, otherwise it will print bar.txt exists if the file bar.txt exists
and is a regular file, otherwise it will print foo.txt and bar.txt do
not exist.
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
Jim Myhrberg commented
It would the init command failed to detect that you're using Fish. Relevant code is here.
You can force init into a specific shell mode, to force it into Fish:
eval (tmuxifier init - fish)
You also can test what comes out of the init command by just manually calling tmuxifier init -
and tmuxifier init - fish
.
Ian Vaughan commented
I no longer use that in my fish setup/sheel, it may of only been required to have ran once, not sure.