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] Run external command directly #17

Closed
lonix1 opened this issue Oct 28, 2021 · 6 comments
Closed

[Feature Request] Run external command directly #17

lonix1 opened this issue Oct 28, 2021 · 6 comments

Comments

@lonix1
Copy link

lonix1 commented Oct 28, 2021

It would be nice to be able to run an external command, like so:

Linux:

"command": "gnome-terminal --working-directory=$(pwd)/src/Foo/ --quiet --command 'ls -lah'",

Windows:

"command": "cmd ...etc.",

That opens the command directly, without going through the built-in terminal, or a companion extension.

As you can see in this extension, it's possible - but that extension is abandonware.

Would be nice to have that functionality in this extension. Thanks!

@AnWeber
Copy link
Owner

AnWeber commented Oct 28, 2021

It is possible to implement the extension. But you could simply use an already existing extension. For example, executing a command in the terminal is easily possible using terminal-command-keys.

{
      "command": "terminalCommandKeys.run",
      "id": "test",
      "text": "terminalCommandKeys",
      "arguments": [{ "cmd": "echo hello world"}]
    }

terminal_command

Do you like the idea?

@lonix1
Copy link
Author

lonix1 commented Oct 28, 2021

Lol you are advertising your competitors' extensions, that's really nice of you!

It uses the built-in terminal. I'm referring to running a shell command external to vscode so it doesn't interfere with internal terminals. That extension i linked to does that - but it hasn't been updated in years, and it's nowhere near as polished as your extension!

Shall I close as "out of scope"? If enough people want it in the future, maybe we can rediscuss :)

@lonix1 lonix1 closed this as completed Oct 28, 2021
@AnWeber
Copy link
Owner

AnWeber commented Oct 28, 2021

It is not competition. For me, it's open source. I want to do one thing and do it right. The other thing others can do better. Your wish is best fulfilled by the extension shell. Only the extension author did not merge the necessary pull request. You would just have to take the code, update the dependencies and publish it (but please mention the origin, do not make the error like nanocolors). It is really simple, keep sharing. If you need help, give me a ping.

@lonix1
Copy link
Author

lonix1 commented Oct 28, 2021

You are a gent, thanks!

@AnWeber
Copy link
Owner

AnWeber commented Oct 28, 2021

you are welcome:-)

@AnWeber
Copy link
Owner

AnWeber commented Oct 31, 2021

It is also implementable with standard VS code functions.

  • add task.json with task
{
	"label": "test",
	"type": "shell",
	"command": "notepad.exe"
}
  • add statusbar command
{
        "text": "test",
        "id": "runTask",
        "name": "runTask",
        "command": "workbench.action.tasks.runTask",
        "arguments": ["test"]
    }

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

No branches or pull requests

2 participants