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

Add VS Code action to run a command in the terminal window inside the IDE #349

Open
ciberkleid opened this issue Apr 24, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@ciberkleid
Copy link

Is your feature request related to a problem? Please describe.

For Spring workshops, it would be more natural to keep the focus on the IDE rather than switch back and forth between IDE and terminal(s). It would be great to be able to issue terminal commands inside of the editor frame in VS Code.

Describe the solution you'd like

Be able to execute a terminal command inside of the IDE, in the terminal frame that is part of VS Code.

Describe alternatives you've considered

No response

Additional information

No response

@ciberkleid ciberkleid added the enhancement New feature or request label Apr 24, 2024
@GrahamDumpleton
Copy link
Contributor

From memory there is a VS Code Editor command you can use with editor:execute-command clickable action to do it. The problem is that Chrome doesn't like that you are trying to send/paste the command to the nested terminal and can display a warning the first time you attempt it and ask for permission, or could outright block it depending on how you may have answered about doing such an operation in the past. So that method wasn't particularly reliable. Also recollect identification of the specific embedded terminal may have been an issue.

I would have to work out what the specific command was as I don't remember.

Another option to consider is using lower terminal layout.

This will stick the terminal below the set of dashboard tabs. Not great for vertical space though.

@GrahamDumpleton
Copy link
Contributor

If not sure how to find out what commands are available for VS Code Editor, you can bring up Keyboard Shortcuts window in the editor and search for "terminal".

The problem is that commands which can be used with keyboard shortcuts don't generally take direct arguments, so to use something like workbench.action.terminal.paste you need to be able to get the text into the paste buffer first. Also not sure from memory whether can paste a newline to trigger running of a command, or whether still need to manually enter return.

@GrahamDumpleton
Copy link
Contributor

Would need to try it, but workbench.action.terminal.writeDataToTerminal command make take an argument of data to write. That may be one I found previously. Can't remember how you select the terminal to target though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

2 participants