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

Execute a code, or a binary as an input for SendInput command #14432

Closed
Hixon10 opened this issue Nov 23, 2022 · 4 comments
Closed

Execute a code, or a binary as an input for SendInput command #14432

Hixon10 opened this issue Nov 23, 2022 · 4 comments
Labels
Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@Hixon10
Copy link

Hixon10 commented Nov 23, 2022

Description of the new feature/enhancement

I propose to extend sendInput command (#3799) . At present, it allows to pass String input, which should be displayed on the terminal. I want to execute a code and display the result, instead of static text.

For example, I want to insert a current git branch to the current terminal cursor position. I can get the name with help git rev-parse --abbrev-ref HEAD. So, I would like to have the following hotkey in the terminal:

{
  "command": {
    "action": "sendInput",
    "input": $(git rev-parse --abbrev-ref HEAD), or ./get-branch-name.exe
  },
  "keys": "ctrl+k"
}

At present, I cannot do it, because input accepts only strings. There are a few workarounds, like, "input": "git rev-parse --abbrev-ref HEAD| Set-Clipboard\r, but they don't allow to insert needed input in place.

@Hixon10 Hixon10 added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Nov 23, 2022
@ghost ghost added Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Nov 23, 2022
@zadjii-msft
Copy link
Member

I love this. I've sorta made similar notes in #12927 in the past, but this does seem... simpler? At least, this seems to make syntactic sense.

Not sure how this would work with #12861

@zadjii-msft
Copy link
Member

Though, admittedly, this is also probably never gonna work.

  • What would the execution model look like?
  • We almost never know the CWD that a shell is running in, so we're more than likely not going to be able to run this in the directory you wanted.

I'm gonna merge this into /dup #12927. Fun suggestion, but technically very challenging 😄

@ghost
Copy link

ghost commented Nov 30, 2022

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost ghost closed this as completed Nov 30, 2022
@ghost ghost added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Nov 30, 2022
@Hixon10
Copy link
Author

Hixon10 commented Nov 30, 2022

#12927 is kinda similar, yes.

Thank you for the answer.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

2 participants