Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax errors after upgrading to 2.2.0. #2216

Closed
jeLee6gi opened this issue Jul 16, 2015 · 6 comments
Closed

Syntax errors after upgrading to 2.2.0. #2216

jeLee6gi opened this issue Jul 16, 2015 · 6 comments
Labels

Comments

@jeLee6gi
Copy link

I don't really know where to start looking for the cause, they are ubiquitous and the error message is not very helpful. Here are some examples:

fish> true
(standard_in) 1: syntax error
test: Missing argument at index 2
fish> false
(standard_in) 1: syntax error
test: Missing argument at index 2
1 fish> echo 'test'
test
(standard_in) 1: syntax error
test: Missing argument at index 2
fish>

This worked fine though:

fish> echo 'test' | cut -b 1
t
fish>
@faho
Copy link
Member

faho commented Jul 16, 2015

Please upload your config.fish and any relevant functions/completions/keybindings.

@zanchey
Copy link
Member

zanchey commented Jul 17, 2015

Sometimes this is because you have defined a function called 'test', which overrides the builtin 'test'.

@zanchey
Copy link
Member

zanchey commented Jul 17, 2015

... although thinking about it now, maybe not. I agree with @faho that your config.fish and any custom functions would be useful to see, particularly fish_prompt; it's also useful to know what version you were upgrading from.

@jeLee6gi
Copy link
Author

I upgraded from 2.1.2.

config.fish

set fish_greeting

set -Ux TERM xterm-256color
set -Ux EDITOR vim

set -Ux GOPATH $HOME/go

if status --is-login
    set PATH $PATH /usr/bin /sbin
end

functions/fish_prompt.fish

set __fish_git_prompt_show_informative_status 'yes'
set __fish_git_prompt_show_cleanstate 'yes'
set __fish_git_prompt_color d32f6f
set __fish_git_prompt_char_stateseparator ''

function fish_prompt

    set last_status $status
    set last_status_string ""
    if [ $last_status -ne 0 ]
        printf "%s%d%s " (set_color red --bold) $last_status (set_color normal)
    end

    set taken $CMD_DURATION
    if test -z $taken
        set taken 0.1s
    end

    set contains (echo $taken | grep 'm')
    if not test $contains
        set contains ""
    end

    if test -n $contains
        notify-send "Command terminated" "Exit status $last_status\nTime elapsed: $taken"
    else
        set temp (echo $taken | sed s'/.$//')
        if test (math "$temp > 10") -eq 1
            notify-send "Command terminated" "Exit status $last_status\nTime elapsed: $taken"
        end
    end

    printf '%s%s%s %s%s%s%s%s ' (set_color 1793d1) $USER (__fish_git_prompt) (set_color $fish_color_cwd) (prompt_pwd) (set_color normal) $user_prompt

end

My other functions are just aliases binding fex, net and twitch to commands.

@zanchey
Copy link
Member

zanchey commented Jul 17, 2015

You're getting bitten by the change to CMD_DURATION in #1585 - see the release notes.

@jeLee6gi
Copy link
Author

Oh sweet, my fish_prompt is going to look so much nicer with the new CMD_DURATION.

Issue solved, sorry for not reading the release notes better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants