When the Source Editor window is not popped out, the issue does not occur
When the Source Editor window is popped out, the issue occurs
Sometimes a different issue occurs in this situation, which is the cursor seems to not be in the editor nor the console. I haven't been able to reproduce this.
I have tried:
Tools > Global Options > Code > Exectuon > toggling "Focus console [...]" ON, restarting R, toggling OFF
To ~/.config/rstudio/rstudio-prefs.json, adding "focus_console_after_exec": false to the JSON.
This looks like an RStudio bug specific to the popped-out Source Editor, rather than a problem with your settings. Your focus_console_after_exec: false setting is the correct option but it apparently isn’t being respected when the editor is detached.
Since the issue disappears when the Source Editor isn’t popped out, the practical workaround is to keep the editor docked. I would also report it as a reproducible bug with your RStudio version and Ubuntu details.
Yes, opening an issue on GitHub is the best practice (in the rstudio/rstudio repo). That's where the RStudio development team (including me) actually go looking for problem reports to investigate.
I can open an issue for this (unless you are super-excited to do it). Post here if you beat me to it, otherwise I'll post a link to it after I open it.
@symbalex Hi, so far I've been unable to reproduce this.
I tried RStudio 2026.08.1 as well as a recent daily build of 2026.09.0 and the cursor stays in the popped-out source editor as I execute code (unless I turn on that setting you mentioned).
I've only tried on Ubuntu 26.04 LTS with Wayland (plus macOS and Windows-11).
What do you get if you run this in the RStudio Console?
.rs.readUiPref("focus_console_after_exec")
Wondering if that setting is somehow stuck in the TRUE state, despite showing as off in the UI.