Skip to content

Add alwaysUseActiveTerminal setting #123#133

Merged
Ikuyadeu merged 4 commits intoREditorSupport:masterfrom
andycraig:issue-123-always-active-term
Oct 13, 2019
Merged

Add alwaysUseActiveTerminal setting #123#133
Ikuyadeu merged 4 commits intoREditorSupport:masterfrom
andycraig:issue-123-always-active-term

Conversation

@andycraig
Copy link
Copy Markdown
Collaborator

Solves #123

What problem did you solve?

Currently, only command R: Run Selection/Line in Active Terminal works for terminals other than the R Interactive terminal. This PR adds a setting r.alwaysUseActiveTerminal (false by default). When this setting is enabled, all commands (R: Run Source, R: Preview Dataframe, R: Knit Rmd etc.) are sent to the active terminal. This allows SSH users etc. to access the full functionality of this extension.

Screenshot

Before this PR, both R: Run Selection/Line and R: Preview Dataframe would have opened a new R Interactive terminal.

always-active

Notes

I needed to create the function chooseTerminalAndSendText outside activate in extension.ts so that it could be exported for use in preview.ts. I decided to put it in rTerminal.ts. I moved the associated terminal choosing/sending functions in there, because they couldn't be exported while inside activate either. I created a separate commit just for moving these functions, to make it easier to compare the changes.

Command R: Run Selection/Line in Active Terminal is probably redundant now, but I left it in there so that this PR doesn't remove any functionality.

@Ikuyadeu Ikuyadeu self-requested a review October 13, 2019 07:33
@Ikuyadeu Ikuyadeu merged commit 148ddd9 into REditorSupport:master Oct 13, 2019
@Ikuyadeu
Copy link
Copy Markdown
Member

Ikuyadeu commented Oct 13, 2019

@andycraig Thank you for a lot of work!
Thanks to your perfect work, I could not find any problem and other tasks that I should do (e.g. Refactoring, Running the tslint, Make a Readme).
So, I will publish this version soon.

@andycraig
Copy link
Copy Markdown
Collaborator Author

@Ikuyadeu Happy to hear that :) Thank you!

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