shell-plugins icon indicating copy to clipboard operation
shell-plugins copied to clipboard

Op run does not preserve color

Open ShravanSunder opened this issue 2 years ago • 7 comments

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

ShravanSunder avatar Dec 08 '23 00:12 ShravanSunder

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.

damccull avatar Mar 13 '24 07:03 damccull

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.

digitalcora avatar Apr 30 '24 15:04 digitalcora

@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.

ShravanSunder avatar May 07 '24 16:05 ShravanSunder

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

jferstl avatar Aug 13 '24 09:08 jferstl

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.

choccccy avatar Aug 16 '24 01:08 choccccy

+1

ubahmapk avatar Dec 12 '24 17:12 ubahmapk

I'm finding op run unusable when trying to use a command after it. For example, op run -- python completely removes any coloring and disables ctrl+r searching history and keying up for history. Works fine if you add --no-masking but ideally secrets are hidden. Pretty please fix

sckott avatar Mar 10 '25 21:03 sckott