Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Allow to specify ENV for the command #145

Open
Dzordzu opened this issue Feb 5, 2024 · 5 comments
Open

[Feature request] Allow to specify ENV for the command #145

Dzordzu opened this issue Feb 5, 2024 · 5 comments

Comments

@Dzordzu
Copy link

Dzordzu commented Feb 5, 2024

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

@NobodyXu
Copy link
Member

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.

@Dzordzu
Copy link
Author

Dzordzu commented Feb 12, 2024

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 :/

@NobodyXu
Copy link
Member

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.

@Dzordzu
Copy link
Author

Dzordzu commented Feb 13, 2024

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

@NobodyXu
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants