Hi, this might be a little bit off-topic. So I just found out that I can launch into the same TMUX window from two separate terminals instance. Basically, this makes it possible to send code to the integrated terminal, but read it from iTerm on a different monitor. It kind of a work-around for the long-standing multi-screen support issue of VScode.
So the only problem here is that, when I hit cmd+enter to send code to integrate terminal, the terminal pane will still be automatically toggled even if it is hidden. I'm wondering if there is any modification I can do to make it "silently" send the code to the terminal without actually toggling the terminal window in vscode?
Hi @albert-ying, that is a neat solution to the multi-screen problem! To clarify: current behaviour is that sending text to the terminal with Ctrl+Enter always makes the terminal appear, but you would like the option to send text without the terminal appearing. Is this correct? This is doable.
I can think of two approaches for implementing this:
Option 1 would be 'always on' or 'always off'. We would need to decide whether it affects all commands that send text to the terminal. Option 2 would mean that you could choose whether the terminal is shown or not each time you send text, by using a different keyboard shortcut.
Hi @andycraig, I'm glad you replied! Yes, that is exactly what I mean. I think both options are great, the first one seems neater and the second one might offer more flexibility for someone who wants to have both behaviors. Thank you!
Since there are several commands that send text to the console, and it would probably be desirable to have the same behaviour for all of them, I propose we use a setting.
There's an existing setting r.source.focus. It currently has options 'editor' and 'terminal'. I propose we add a new option ('none' or 'hide' or something like that) which has the requested behaviour.
This should be fairly straightforward to implement. @albert-ying Are you interested in implementing this yourself? The code that would need to be modified is here: https://github.com/Ikuyadeu/vscode-R/blob/16737cb499a6ef91daa247bbd437808099b98a16/src/rTerminal.ts#L267-L270
Hi @andycraig. Thank you for figuring it out!
Sorry, I would more than happy to do it if I could. But I only use R and I don't actually know Typescript (I suppose this is the language used here).
@albert-ying TypeScript is the language used but it's pretty intuitive coming from R. No pressure though :) I can add this feature some time in the next month or so.