Pass variables to stdin (was: Option to pass editor selection to command’s stdin) #89
Replies: 8 comments 12 replies
-
I’m happy to make a PR for that - I have it written already, actually, just working through some edge case handling - but wanted to get feedback on the best user experience for it before finishing up and submitting it. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your idea! I converted your issue to a discussion, as I'd like to first plan this kind of thing a bit more. I have had Also, if |
Beta Was this translation helpful? Give feedback.
-
Great idea about populating the stdin from any variable! Or even a template string with the potential to expand multiple variables. The two main benefits I see to stdin vs the existing variable-expansion support are avoiding escaping (potentially simplifies logic, plus safer because it avoids any bugs that might exist in the escaping logic) and command line length limits. The latter isn't relevant most of the time, but on my Mac the shell command line maxes out at 1MB, and historically Windows has had a much shorter command line limit (caveat: I don't often use a Windows machine these days, so I'm not sure if that's still the case). |
Beta Was this translation helpful? Give feedback.
-
Damn, when I converted issue #88 to this discussion, I thought that I would be able to later continue using that issue to add a comment there which would contain a summary/plan for the feature, but there's no way to reopen the commenting part for it now that I did this conversion. I need to create a new issue, but I'll do it when I have the plan ready. My idea for discussions and issues is that discussions can be used for things that are still uncertain, and an issue will have a condensed summary of the discussion, containing things that are decided to be implemented. Issues are also used in Roadmap, because discussions cannot be included in it. |
Beta Was this translation helpful? Give feedback.
-
Just came to my mind, that while What I'm thinking further, is the ability to define extra input channels in addition to But basic |
Beta Was this translation helpful? Give feedback.
-
I'm not familiar with making new file descriptors, but you can make named or anonymous pipes easily enough and use those as channels. Maybe name them with some convention like However, I've played with your suggestion of |
Beta Was this translation helpful? Give feedback.
-
I'm planning to implement this in
|
Beta Was this translation helpful? Give feedback.
-
Hi! I'm quite new to the plugin and most likely I'm streching the capabilities of
I know what I'm doing is not very secure as well, at least could be, but anyways, this is how I learn things and maybe there is something in Shell-Commands I don't know yet. The command I try to make work is this one In any case, the ideal situation would be that the cli is showing and I can type the passphrase there. |
Beta Was this translation helpful? Give feedback.
-
I’d really like to be able to pipe the editor’s current selection to a command on its stdin fd. I think that option should be a toggle in the per-command settings modal.
Beta Was this translation helpful? Give feedback.
All reactions