dploeger / idea.shellfilter

The IDEA Shell Filter plugin
https://plugins.jetbrains.com/plugin/9958-shell-filter
Other
5 stars 0 forks source link

base64 filter ignoring args #5

Closed gnanderson closed 3 years ago

gnanderson commented 3 years ago

Hi, thanks for this plugin.

If I have a command defined as base64 -w 0 the filtered output is what I would expect if I ran base64 with no args.

dploeger commented 3 years ago

I'm glad if it helps you.

I don't quite get what you're saying here. Do you mean, that adding a command with "base64" somehow messes up the output and that you have to use "base64 -w 0" instead?

gnanderson commented 3 years ago

I'm not sure if it's the plugin or, the way the output is interpreted in the buffer (also using IdeaVIM):

if I run the string vault:devops/data/cluster/office/spinnaker#githubClientID through base64 in a standard shell it wraps the output at the default column 76:

`dmF1bHQ6ZGV2b3BzL2RhdGEvY2x1c3Rlci9vZmZpY2Uvc3Bpbm5ha2VyI2dpdGh1YkNsaWVudElEC

g==`

So instead I use no line wrap with option -w 0, the resultant string naturally is: dmF1bHQ6ZGV2b3BzL2RhdGEvY2x1c3Rlci9vZmZpY2Uvc3Bpbm5ha2VyI2dpdGh1YkNsaWVudElECg==

However when I set base64 -w 0 as the command in the plugin, the string is truncated as if it has just been passed through base64 with no options. Instead of the full string the replacement is: dmF1bHQ6ZGV2b3BzL2RhdGEvY2x1c3Rlci9vZmZpY2Uvc3Bpbm5ha2VyI2dpdGh1YkNsaWVudElE

gnanderson commented 3 years ago

I see that Cg== is the base64 for newline, hmm :thinking:

dploeger commented 3 years ago

Hm. The problem is, that my base64-implementation doesn't support the -w parameter, so I can not try to reproduce it here.

Can you disable ideavim just to rule it out?

gnanderson commented 3 years ago

@dploeger that seems better, I'll poke about with IdeaVIM and if I can't figure it out I'll raise an issue - thanks for the plugin & your help - sorry for the noise!

dploeger commented 3 years ago

Oh, right. No problem. Anytime. :)