tmux: (how) can I close a pane or window without closing the window selection tree or the containing terminal - tmux

Title says it:
open a terminal
Ctrl-b w
observe you can walk through open windows/panes through the selection tree
Now I can close the selected pane or window with Ctrl-b &/w, but it closes the whole terminal. What I want instead, is to close the window that is selected in the tree, but keep the tree and the containing terminal open. (Which means that (implicitly) I'd want tmux to close the selected window/pane but jump to the next one and update the view without actually closing the containing terminal window.)
How to achieve this?

Related

R (Rstudio) I forget a ) and my whole script is executed...Is there a way to stop that?

I have a question about R (personnaly working on it via RStudio). Is there is a magic trick to stop my 2600+ line script to be fully executed whenever I launch a line (ctrl+enter) in which I have forgotten a )
Whenever it happens, I find myself clicking like a maniac on the red "STOP" button on Rstudio but still lose precious minutes.
Thanks a lot!
I guess it partially depends on how you're running your script.
If you highlight a selection of code and then do something like ctrl+enter to run those lines then... no. You're kind of stuck doing what you're doing.
If you switch to using ctrl+shift+enter (which is the shortcut for "Source with echo") then you can press the Stop button once and it will cease executing completely.
If you're too used to using something like Ctrl+enter you can modify the keyboard shortcuts to use "Source with echo" instead of just "Run current line or selection"

Snapshoting a workspace in WM: layout and programs which are opened

I was wondering if it was possible to snapshot a workspace, i.e. save state not only of the layout but also of the windows which were opened.
Why do I need this?
Because I switch between different workflows. I may program for a while and then I may want to switch to a different activity, then switch back again to programming. On the average I have up to 7 windows on my workspace.
I need to save RAM for (freeze and lag)-less workflow.
I want to be able to close workspace 1, switch to another - workspace 2, then restore workspace 1 from the point when I had left it.
This should be totally manual, so I still can work on multiple workspaces. I have to control whether I want to close and restore previous workspace session.
When I restore the workspace, it should be just like I had left it, given that I hadn't changed the files or deleted programs that were opened.
Can this be done at all or at least some part of it with any WM?
Is this a stupid idea?
Does not running a graphical UI saves me RAM (how much)? - so maybe the windows should not be killed when closed, but rather run in the background (daemon), like in Tmux.
Earlier I tried i3 and Awesome(briefly). The biggest struggle was the toolbar, manual set up of volume, brightness, language switching control and proper fonts (on Arch Linux), I didn't fully succeed in setting my environment(I skimmed through wikis) so I fled.
Is it easier to set up Awesome in this respect?
Currently I use Cinnamon+Debian, and I'm almost happy with it.
I'd like to use touchpad less and therefore ask for advice.
I'll try to set WM up on VM first for painless transition.
I've done something similar before in i3-wm. I created a keybind to a bash script in my path that opens four terminator terminals on an empty screen. It uses the i3 command i3-msg to tell the window manager how the behavior of the next window opened will change. Here is my script:
terminator # opens terminal, change to the terminal that you use
i3-msg split h # tells i3 that the next window should split screen vertically
terminator # opens terminal
i3-msg split v # tells i3 that next window should split current one horizontally
terminator # opens terminal
i3-msg focus left # Changes selected window to the left one
i3-msg split v # tells i3 that the next window should split screen vertically
terminator
You should be able to take the i3-msg command and use it to control how windows of your applications open.
This is a quick, hacky solution, but it does work.
I hope this was able to help!
phylo

Is there a way to give a name to a Rscript window?

I launch an R script with the following code using Windows 10
system('"C:/Program Files/R/R-3.5.1/bin/Rscript.exe"
"C:/Users/.../myfile.Rscript"', wait=FALSE, minimized=FALSE, invisible=FALSE)
I would like to give a name to the window that is opening which should be visualized in its upper bar. (See the image)
Furthermore, I'd like to know if there is a way to launch this command and prevent the window from opening above every other window on the desktop. I would like to run it in a minimized mode (I tried with the minimized=TRUE but it doesn't work).

How to Run a Single Line in RStudio

I am used to using the standard R GUI but I'm trying to make the switch to RStudio. However, it's driving me nuts that I can't figure out how to run a single line with a keyboard shortcut. For instance, if I have the two lines,
c <- a +
b
I would like to press ^R to run the first line and then have to press ^R again to run the second line to complete the assignment. This is the default setting in the standard R GUI. Unfortunately, RStudio only seems to want to execute a statement to it's completion. Is there any way around this?
If you want this to be the default behavior, go to "Tools -> Global Options -> Code -> Editing" and uncheck the box "Execute all lines in a statement" under "Execution".
Select the first line (by clicking on it three times), then Ctrl-Enter will run the selection, not the statement.

Hotkey to run the entire script

Is there a hotkey (or can I create one) to run the active entire script with only one hotkey? Currently I have to use CTRL+A (select all lines) and ALT+ENTER (run current selection).
For example, in MATLAB I could use the F5 hotkey to run all the script.
Edit:
I use Rstudio
Two items from the Source pull-down menu (Windows version):

Resources