weixin_39810441
weixin_39810441
2020-11-23 11:07

Fish shell incomptibility "Expected a variable name after this $"

I use OSX, I use fish as my default shell.

Whenever I try to enter shell-command in Far I get error like this:

2018-12-22 17-04-03

该提问来源于开源项目:elfmz/far2l

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

7条回答

  • weixin_39810441 weixin_39810441 5月前

    https://github.com/fish-shell/fish-shell/issues/3634 suggests that $ should be escaped in fish, but bash-like shells do not support vars in that position so it is not a problem there

    点赞 评论 复制链接分享
  • weixin_39810441 weixin_39810441 5月前

    Here's the line: https://github.com/elfmz/far2l/blob/59673f073d48e76e4336158f5464449ee72ae8df/far2l/vtshell.cpp#L350

    点赞 评论 复制链接分享
  • weixin_39810441 weixin_39810441 5月前

    I applied patch locally: it works, but fails on the next step:

    
     ~   . /tmp/far2l_1f7_0/vtcmd/176ef_0x7fe3e842a870;echo -ne "=$FARVTRESULT:"\$'\x49\x57\x69\x6a\x35\x32\x77\x74\x70\x37\x34\x76\x5a\x33\x58\x58\x1b\x5b\x31\x4b'          
    /tmp/far2l_1f7_0/vtcmd/176ef_0x7fe3e842a870 (line 14): Unsupported use of '&&'. In fish, please use 'COMMAND; and COMMAND'.                                                
    cd "/Users/indy" && ls                                                                                                                                                     
                      ^                                                                                                                                                        
    from sourcing file /tmp/far2l_1f7_0/vtcmd/176ef_0x7fe3e842a870                                                                                                             
            called on line 230 of file /opt/homebrew/Cellar/fish/2.7.1/share/fish/config.fish                                                                                  
    
    in function '.'                                                                                                                                                            
            called on standard input                                                                                                                                           
    
    source: Error while reading file '/tmp/far2l_1f7_0/vtcmd/176ef_0x7fe3e842a870'                                                                                             
    

    fish has different syntax and far either needs to have custom code for different shells or use bin/sh or bin/bash (?) explicitly

    点赞 评论 复制链接分享
  • weixin_39980129 weixin_39980129 5月前

    What does 'which fish" report on your system?

    点赞 评论 复制链接分享
  • weixin_39980129 weixin_39980129 5月前

    try now (after https://github.com/elfmz/far2l/commit/58382199ebff9182c7d83029c6ca13e7f4f99bab )

    点赞 评论 复制链接分享
  • weixin_39810441 weixin_39810441 5月前

    What does 'which fish" report on your system?

    /opt/homebrew/bin/fish

    try now

    yes, much better!

    点赞 评论 复制链接分享
  • weixin_39980129 weixin_39980129 5月前

    so, fixed..

    点赞 评论 复制链接分享

相关推荐