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

feat: allow commands to be run in the last active terminal #43

Merged
merged 1 commit into from
May 7, 2023

Conversation

pd93
Copy link
Member

@pd93 pd93 commented May 3, 2023

This PR addresses some of the comments in #12 (but not all of them!).

Basically, I haven't had time to fully explore all the possibilities here, so this feature is intended to address only the most basic requirements.

A new setting task.outputTo has been added which can be set to output or terminal. I have not changed the default for now as there likely to be more changes to the terminal output in the future. Users of the terminal option should consider this experimental and subject to change. The semantics of the feature are described below:

If you have task.outputTo set to output (default), then the extension will behave in the same way that it did before this change. i.e. It will output Task commands and their outputs to the output panel. The only small change here is that ANSI codes will now be stripped from the output as colors cannot be rendered in this panel.

If you have task.outputTo set to terminal, Task will grab the last active terminal and send the command to that instead. If no active terminal is found, we will create one and focus it. It is super important to note that we are not doing ANY checking as to whether or not that terminal has an active process (I'm not sure if this is even possible with the VSCode API), so if you are already running a command or a TUI etc, you definitely want to be careful or you're going to end up sending a bunch of text into whatever TUI you have running.

@pd93 pd93 force-pushed the support-output-to-terminal branch from f03e588 to b64fe15 Compare May 7, 2023 00:20
@pd93 pd93 merged commit 8c68122 into main May 7, 2023
@pd93 pd93 deleted the support-output-to-terminal branch May 7, 2023 00:20
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

Successfully merging this pull request may close these issues.

2 participants