1Password / shell-plugins

Seamless authentication for every tool in your terminal.
https://developer.1password.com/docs/cli/shell-plugins/
MIT License
519 stars 170 forks source link

Op run does not preserve color #413

Open ShravanSunder opened 10 months ago

ShravanSunder commented 10 months ago

op CLI version

2.22

Goal or desired behavior

I'm running op run with wrangler op run --env-file='.dev.vars' -- wrangler dev src/worker.ts --port 8888

The colors from wrangler and the formatting of its cli is not preserved

Current behavior

The cli removes color and formatting. Its hard to parse debug information and makes it hard to use 1p cli

Relevant log output

No response

damccull commented 6 months ago

Also experiencing this, but with rust's cargo run and other commands. Edit: I can pass the --color=always option to cargo to get it to keep color. I imagine this is happening because the pipe into op is not advertising it can accept color or something. Not sure how that works.

digitalcora commented 5 months ago

This issue appears to be tied to the "masking" feature, since I get color output using op run --no-masking (or when there are no op:// references in the environment, which I guess disables the feature automatically). Of course, if you use this as a workaround, you don't get the benefit of masking.

ShravanSunder commented 4 months ago

@florisvdg sorry to ping you, i wanted to reach out to someone in 1p team.

Is it possible for someone from 1p to look at this? It makes it hard to use op cli to protect secrets when it changes the behaviour of the commands we need to invoke.

jferstl commented 1 month ago

I have the same issue with op run -- docker compose ... where the neatly formatted output by docker is not preserved.

choccccy commented 1 month ago

This issue appears to be tied to the "masking" feature, since I get color output using op run --no-masking (or when there are no op:// references in the environment, which I guess disables the feature automatically). Of course, if you use this as a workaround, you don't get the benefit of masking.

I also run into this issue, and find that using the --no-masking arg fixes it.