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

R CMD Check: executing task switches focus from console to terminal #1721

Open
EmilHvitfeldt opened this issue Oct 30, 2023 · 5 comments
Open
Labels
Milestone

Comments

@EmilHvitfeldt
Copy link

Positron Version:

Positron Version: 2023.10.0 (Universal) build 1453
Code - OSS Version: 1.83.0
Commit: b781e9e
Date: 2023-10-30T03:03:08.650Z
Electron: 25.8.4
ElectronBuildId: undefined
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Darwin arm64 22.6.0

Steps to reproduce the issue:

  1. Be in R package
  2. type E + shift + command
  3. click any key when done

Start of check
https://github.com/posit-dev/positron/assets/14034784/8661fbec-6d60-47b9-8f8c-b7d3b03e1e9f

end of check
https://github.com/posit-dev/positron/assets/14034784/5b69d3db-aebc-4286-8530-1f4691d374bd

What did you expect to happen?

Once I click the key, i expect to end back up into the console where i started. Which is what happens when I do B + shift + command

Were there any error messages in the output or Developer Tools console?

Nope

@EmilHvitfeldt
Copy link
Author

further testing reveals that B + shift + command always opens the console when done, no matter if you are in the terminal or console.

I feel like both should send you back to where you started

@juliasilge
Copy link
Contributor

This is happening right now because cmd + shift + B only executes code in the current R session in the console while cmd + shift + E goes to the terminal to execute a "task" (separate session). We eventually want to have something akin to a Build Pane (see #1486) that is like a special terminal that can show the user results, definitely without stealing focus from the Console.

@EmilHvitfeldt
Copy link
Author

Small update on this issue. With the new improvements, both cmd + shift + B and
cmd + shift + E are done as tasks (as far as I can tell).

cmd + shift + B is executed as a task, in the terminal window, but focus is given back to the console after, which I like. Without any user input which also like.

cmd + shift + E is executed as a task, in the terminal window. The results stay, which is good. But once you click out of it, you are not transported back to the console.

I would like to be sent back to the console at this stage, everything else feels good!

Kapture.2024-01-18.at.11.32.00.mp4

@juliasilge
Copy link
Contributor

We could wait for the task to end and then do vscode.commands.executeCommand('workbench.panel.positronConsole.focus') like we do for the cmd + shift + B command, if we do want to make this change. I do feel a little unsure about bringing the focus back to the console in the 'r.packageCheck' case because that command happens all in the terminal.

@jennybc
Copy link
Member

jennybc commented Jan 19, 2024

I really don't think we should focus the Console after check, because that just encourages folks to not actually read their check results. I do know what you're talking about, though, @EmilHvitfeldt. I process this as more evidence that we need a build pane, which is #1486. As it stands, we are forced to choose between having the R Console visible and the R CMD check results visible, because they're down there competing for the same real estate.

@jennybc jennybc added this to the Release Candidate milestone Feb 23, 2024
@wesm wesm added the lang: r label Feb 29, 2024
@juliasilge juliasilge modified the milestones: Release Candidate, Future Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants