REditorSupport / REditorSupport/vscode-R

The editor (sometimes) loses focus when commands that open an interactive viewer are executed

Open
#1,658 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
1.2k
Forks
139
Avg merge
2h 46m
Merged PRs (30d)
5

Description

Describe the bug

The editor (sometimes) loses focus when commands that open an interactive viewer are executed. We must then click again in the editor to get focus back.

To Reproduce

I am not able to always reproduce, but the editor often loses focus when executing with e.g.:

plot(mpg ~ hp, mtcars)
View(mtcars)
?plot

Can you fix this issue by yourself? (We appreciate the help)

No

Expected behavior

The editor should not lose focus when an interactive viewer is opened.

Environment (please complete the following information):

  • OS: all
  • VSCode Version: VSCodium 1.106.37943
  • R Version: all
  • vscode-R version: 2.8.6

Additional context

FWIW, RStudio editor does not lose focus when showing plots (e.g. plot(mpg ~ hp, mtcars)) or help (e.g. ?plot). With default layout, the editor lose focus when showing objects (e.g. View(mtcars)) because the viewer is open "on top" of the editor.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the focus loss with the R commands plot(mpg ~ hp, mtcars), View(mtcars), and ?plot in the described VS Code environment. Trace how opening each interactive viewer affects editor focus, including the default layout behavior for View; done means the editor retains focus whenever an interactive viewer opens.

Written by the indexing model from the issue text.

Assessment

Tech stack
r, typescript, vscode
Domain
desktop-dev, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.