Uploaded image for project: 'Funtoo Linux'
  1. Funtoo Linux
  2. FL-2006

Keychain --eval code for Fish is missing semicolons

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Severe (Ebuild) Severe (Ebuild)
    • None
    • None
    • None
    • Fish 2.1.1

      The code keychain --eval emits for fish looks like

      set -e SSH_AUTH_SOCK; and set -x -U SSH_AUTH_SOCK /tmp/ssh-7BecKqFiVNce/agent.2580
      set -e SSH_AGENT_PID; and set -x -U SSH_AGENT_PID 2767
      
      set -e GPG_AGENT_INFO; and set -x -U GPG_AGENT_INFO /tmp/gpg-23iZ8D/S.gpg-agent:2768:1
      

      If you try to eval this, Fish doesn't interpret the newline as a new command, and jams set -e SSH_AGENT onto the end of SSH_AUTH_SOCK, and so on. A simple workaround: swap out newlines for semicolons in your .config/fish/config.fish:

      # Load SSH Keys
      if status --is-interactive
        eval (keychain --eval --quiet -Q id_rsa | tr \n \;)
      end
      

            Unassigned Unassigned
            aphyr aphyr [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: