1Password CLI seems to break apps that use readline

evanB
evanB
Community Member

Hey there, I'm trying to use the 1Password CLI with psql, the PostgreSQL interactive terminal, but I'm running into some unexpected behavior with the interactive readline input of that process. After connecting to a database server psql normally outputs some text and displays a prompt, but this doesn't happen when running psql through the 1Password CLI. Example: op run --env-file=$HOME/.env-psql -- psql

I can still enter psql commands, and they do output, but the experience is not great. All of the readline functionality seems to be unavailable, such as showing a prompt and using the arrow keys to scroll through previous commands. Arrow keys show up as terminal input sequences ^[[A. The exit command does not work with psql anymore, so I have to send ^C.

asciicast

This is even easier to reproduce if you run bash.

asciicast


1Password Version: OP CLI 2.4.1
Extension Version: Not Provided
OS Version: macOS 12.3

Comments

  • Hey @evanB,

    Thank you for raising this! Indeed, there seems to be a problem with op run's masking functionality, which seems to also affect the interactive features of terminals. Can you please confirm if adding the --no-masking flag to your command helps? We want to make sure this is the same problem that we're aware of, or whether this is something different.

    We currently have an open issue for this. We'll make sure to keep you updated once there are any developments related to this.

    Best,
    Horia

  • evanB
    evanB
    Community Member

    Hey @Horia.Culea_1P,

    The --no-masking flag helps!

    asciicast

  • Thank you for confirming! Will keep you posted with any developments here.

    Best,
    Horia

  • manu559
    manu559
    Community Member

    Came here for the same issue. For me it breaks ipython. --no-masking resolves it.

  • Thanks for the feedback @manu559!

  • cmeury
    cmeury
    Community Member

    Just stumbled across the same issue, troubleshooted for way too long until I realized the command is actually working but just swallowing the prompt. Maybe add a warning in the reference about op run?

  • Thanks @cmeury, we currently have an open issue for this. We will update you with any developments.

    Best,
    Andi

  • technicalpickles
    technicalpickles
    Community Member

    I ran into this with calling Ruby's irb. Also got it when trying to run interactive shells through it. --no-masking is a good workaround though.

This discussion has been closed.