Skip to content

Add option to keep terminal hidden after running code#566

Merged
andycraig merged 2 commits intoREditorSupport:masterfrom
andycraig:hidden-terminal
Mar 6, 2021
Merged

Add option to keep terminal hidden after running code#566
andycraig merged 2 commits intoREditorSupport:masterfrom
andycraig:hidden-terminal

Conversation

@andycraig
Copy link
Copy Markdown
Collaborator

Closes #510

What problem did you solve?

This PR adds an option 'none' to r.source.focus to keep the terminal hidden after sending code to the terminal.

How can I check this pull request?

With session watcher on.

  1. Add this line to settings.json:
    "r.source.focus": "none"
  1. Run command R: Create R terminal
  2. Hide the terminal by clicking the X at the top right
  3. In a file 'temp.R', write this code and send it to the terminal: plot(1, 1)
  4. Observe that the plot window appears (so the code was executed), but the terminal stays hidden

Note

I believe r.source.focus is the right setting for this option, but I am concerned that the difference between the options 'editor' and 'none' is not obvious. I have updated the description with this in mind so please check whether you think it is clear enough.

@renkun-ken
Copy link
Copy Markdown
Member

Works as expected.

It looks like we have two ways to address this:

  1. Two options to control what to focus and whether to reveal terminal. But I guess nobody really needs "focus on the terminal but not reveal it".
  2. One option (like implemented in this PR) to control both behavior.

From the perspective of improving an existing option rather than introducing a new one, I guess the one option makes more sense to me.

Copy link
Copy Markdown
Member

@renkun-ken renkun-ken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@andycraig
Copy link
Copy Markdown
Collaborator Author

@renkun-ken Thank you for the review! Exactly, I agree that there's two possible approaches here. In the issue discussion I initially proposed a new setting. Then I changed my mind and suggested it be added as a new option to the existing setting. As you note, it's hard to imagine anyone wanting the combination 'focus on the terminal but don't reveal it', and this way we avoid people choosing that combination accidentally.

I will go ahead and merge.

@andycraig andycraig merged commit 9ac210c into REditorSupport:master Mar 6, 2021
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.

Send the code to the terminal without automatic toggling of terminal pane.

2 participants