openssh icon indicating copy to clipboard operation
openssh copied to clipboard

[Feature request] Allow to specify ENV for the command

Open Dzordzu opened this issue 2 years ago • 5 comments

Description

Allow to set env during command sending process

Current behavior

Error, as specified in the docs

OP help

Unfortunately, not possible as of now

Dzordzu avatar Feb 05 '24 15:02 Dzordzu

Thanks for reporting, bit busy and will investigate later.

Do you know that you can use tempfile plus the openssh::Builder to override the ssh-config and specify the env within it?

While it's a stop-gap solution, it might be handy if you need it.

NobodyXu avatar Feb 12 '24 12:02 NobodyXu

Do you know that you can use tempfile plus the openssh::Builder to override the ssh-config and specify the env within it?

I know it. Unfortunately the env is different for every command :/

Dzordzu avatar Feb 12 '24 13:02 Dzordzu

Hmmm seems that you would definitely need openssh support for this.

As an alternative, you can change command to be run to env, then pass env as A=B, then pass the original cmd and args.

NobodyXu avatar Feb 12 '24 22:02 NobodyXu

As an alternative, you can change command to be run to env, then pass env as A=B

I've been aware of this option. Overall it could be a solution. On the other hand I consider it as a huge, dreadful hack. At least doing it manually. It either requires me to write an additional wrapper around library, or perform these changes on every command execution. Both of these options are... I don't like them xD

Dzordzu avatar Feb 13 '24 01:02 Dzordzu

I agree, I will investigate to see if there's better solution.

NobodyXu avatar Feb 13 '24 05:02 NobodyXu