Skip to content

gopass edit fails: -c option, 1: The - command is unknown #2424

Description

@ehaupt

In continuation of #2412 the -c flag needs to be dropped if vi is not a real vim.

$ gopass edit foo
-c option, 1: The - command is unknown

Activity

  1. dominikschulz commented on Nov 22, 2022

    @dominikschulz
    Member

    sigh Thanks for the feedback. I'm starting to think that we should maybe just require (a real) vim ...

  2. added this to the 1.14.11 milestone on Nov 22, 2022
  3. dominikschulz commented on Nov 22, 2022

    @dominikschulz
    Member

    But for the time being I should start to use/test gopass with a non-vim vi.

  4. ehaupt commented on Nov 22, 2022

    @ehaupt
    Author

    sigh Thanks for the feedback. I'm starting to think that we should maybe just require (a real) vim ...

    I understand the sentiment but that would blow up the dependency chain quite a lot.

    It's safe to assume that $EDITOR FILE will suffice.

    If you like to test the FreeBSD port you can quickly spin up a vagrant box. This one should suffice.

    Thank you for the quick response 😺

  5. added 2 commits that reference this issue on Nov 25, 2022
    27cb8ba
    9feca34
  6. added a commit that references this issue on Nov 25, 2022
    6dba8a7
  7. nunotexbsd commented on Nov 25, 2022

    @nunotexbsd

    1.14.11
    EDITOR=vi

    gopass edit foo

    🚥 Syncing with all remotes ...
    [<root>]
       gitfs pull and push ... Skipped (no remote)
    ✅ All done
    ✅ Found exact match in "websites/foo.com/foo"
    Secret does not exist "foo". Found possible match in "websites/foo.com/foo". Edit existing entry? [Y/n/q]: y
    vi: illegal option -- i
    usage: ex [-eFRrSsv] [-c command] [-t tag] [-w size] [file ...]
    usage: vi [-eFlRrSv] [-c command] [-t tag] [-w size] [file ...]
    
    Error: failed to invoke editor: failed to run vi with /tmp/gopass-edit3796617766/secret file: exit status 1
    
  8. nunotexbsd commented on Dec 2, 2022

    @nunotexbsd

    Shouldn't vi options set to {} like nvi?

    "vi":     {"-c", "autocmd BufNewFile,BufRead /dev/shm/gopass* setlocal noswapfile nobackup noundofile viminfo=\"\"", "-i", "NONE", "-n"},
    "nvi":    {},
    "neovim": {"-c", "autocmd BufNewFile,BufRead /dev/shm/gopass* setlocal noswapfile nobackup noundofile shada=\"\"", "-i", "NONE", "-n"},
    "vim":    {"-c", "autocmd BufNewFile,BufRead /dev/shm/gopass* setlocal noswapfile nobackup noundofile viminfo=\"\"", "-i", "NONE", "-n"},
    

    IMHO nvi and vi options should be set to {}

    Tested with EDITOR=nvi (defaults FreeBSD EDITOR=vi)

  9. dominikschulz commented on Dec 2, 2022

    @dominikschulz
    Member

    Yes, I think you are right. We must at least check if vi is actually a vim. And then this test might fail depending on where it's run. Oh what a fun ...

    Let me reopen this, again.

  10. added a commit that references this issue on Dec 6, 2022
    3865a45
  11. dominikschulz commented on Dec 6, 2022

    @dominikschulz
    Member

    I was able to reproduce the issue. The test isn't very elegant, but the workflow should now at least work.

  12. added a commit that references this issue on Dec 7, 2022
    0ebf65f
  13. nunotexbsd commented on Dec 8, 2022

    @nunotexbsd

    Works fine with vi/nvi.

    Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    ⌂ 换网址