title: How to control Rstudio switching between windows?
body: <p>Although I find Rstudio excellent, I have some problems with automatic switching back to the source pane. A typical example would be that I am creating a script, lets say it contains (from ?lm):</p>
  
  <pre><code>ctl &lt;- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
  trt &lt;- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
  group &lt;- gl(2, 10, 20, labels = c("Ctl","Trt"))
  weight &lt;- c(ctl, trt)
  lm.D9 &lt;- lm(weight ~ group)
  </code></pre>
  
  <p>Then I want to check something inside the lm function with debug from console:</p>
  
  <pre><code>debug(lm)
  lm.D9 &lt;- lm(weight ~ group)
  ...
  Browse[2]&gt; Q
  </code></pre>
  
  <p>After I finish browsing with Q, the focus automatically changes back to the source, even if I have already been working in the console for a while. This can be quite annoying as selected text in the source pane will be deleted when I touch any key. And this might go unnoticed if I am concentrated on what I wanted to do in the console and I switch back without checking what happened with the source. </p>
  
  <p>After some googling, I thought this might be changed with </p>
  
  <pre><code>Options/Code Editing/Focus console after executing from source
  </code></pre>
  
  <p>However, the focus did still switch back to the source after ending the browser! </p>
  
  <p>Any ideas how to turn off this behavior? I think (could be wrong) that this was different in the earlier version I had of Rstudio. My current is 0.98.978.</p>