Using Console2 with the R terminal - r

I am trying to configure Console2 to use the R terminal.
I created a new tab named "R" and under the shell directory I linked it to:
...\R\R-3.1.3\bin\x64\R.exe. Console 2 just hangs for a few seconds and then reappears in the corner of my desktop with the window completely resized as small as it will go. You cannot resize it in this state - it just jumps back. The only option is to quit.
If I instead link to ...\R\R-3.1.3\bin\R.exe it works fine except that if I alt-tab to another window and then return to the terminal I am unable to type anything in R tab for Console2 or delete previously typed characters. It's completely unusable and I have to restart.
Is this a bug or am I doing something wrong?

This is something I've been experiencing myself and it seems to be a bug - it happens with most other shells I used under Console2. The only solution that worked for me was to use a modified version of Console2 called ConsoleZ, which is found under: https://github.com/cbucher/console - it has many other useful options and it's more actively developed. Hope it helps.

Related

tcltk Dialog Boxes Appear Underneath RStudio/Shiny Windows

I am currently programming my first shiny application and I am having some difficulty with some of the more subtle user interface features. I am using the tcltk library to import a number of simple dialog boxes for the user to select local directories and files (the application is only going to be run locally so I will not be using shiny's fileInput commands). This also has the advantage of not being OS specific like the choose.dir command (see R Windows OS choose.dir() File chooser won't open at working directory for more discussion on that).
However, when I'm working in Windows (I'm testing on Windows 10 although I do most of the development work in Linux), I'm finding that calls to tkchooseDirectory only opens up the dialog box behind the shiny application, if I'm running a shiny application, or behind the RStudio IDE if I'm just calling it from the console there. This doesn't seem to be a new problem: http://r.789695.n4.nabble.com/tkchooseDirectory-opens-dialog-below-browser-window-td4729500.html but I haven't seen any solutions yet.
For my development work with the RStudio console then this is a minor nuisance but, given that the shiny application will be eventually be delivered to the client (a state agency), I would really rather not aggravate them with dialog boxes being hidden by the application.
Thank you for any help that you can provide!
[edit 1] Further information: it appears that when calling tkchooseDirectory from the RStudio console, only the first call to tkchooseDirectory results in a dialog box being displayed behind the application. Subsequent calls place the dialog box to the top of the display as expected. Also, this behaviour does not happen in the R for Windows GUI and seems to be something perculiar to RStudio and its associated products.
[edit 2] It appears that others have experienced similar problems with other tcltk library dialog boxes too: MessageBox in R
[edit 3] The easiest minimal example to see this is by running:
library(tcltk2)
tkchooseDirectory()
in the RStudio console on a Windows 10 system.
So, I don't think there's a direct solution to this unfortunately ...
One option is to raise a toplevel window and then the directory dialog on top of it (you have to run everything at once here, otherwise the root is in the background again).
library(tcltk2)
root = tktoplevel("width" = 1, "height" = 1)
tkraise(root)
tkchooseDirectory("-parent", root)
Another option would be to use gWidgets.
dir_ <- gWidgets::gfile(type = "selectdir")
I found it best to pause using Sys.sleep briefly prior to opening the dialog:
root = tktoplevel("width" = 1, "height" = 1)
tkraise(root)
Sys.sleep(1) #pause just a little for dailogs
selectedDir <-
tclvalue(tkchooseDirectory(
initialdir=getwd(),
title="Select directory"))
tkdestroy(root)

Modelsim reset all windows

This seems a rather silly question: but I can't find (for more than an hour) now a button to "reset" all standard windows.. I accidentally closed quite a lot of them during a crash. (Especially the "command window" and the signals-in-region during simulation seem to be gone permanently).
From "ModelSim User’s Manual, v10.1d", appendix F:
Most user GUI preferences are stored as Tcl variables in the .modelsim file on Unix/Linux
platforms or the Registry on Windows platforms.
You may consider to look into .modelsim, and possibly delete it, together with .modelsim.bak. The motivation for this suggestion is that .modelsim contains setup details for the layout of panes. .modelsim will (should!) be regenerated next time you open modelsim.
At the menu bar (main window), click on layout and then choose reset. Most of the windows will be reset.

How to make tmux's reaction faster?

I use tmux and find one problem of it.
For example, I make 2 panes within 1 window under tmux.
In one pane, I compile Linux kernel and as you know it will output a lot of message there.
During the compilation, in another pane of tmux, when I tried to input some command, it will react very slow.
How to solve this?
Thanks!
BR
With two panes, tmux has to update two portions of the screen at once. My suggestion is to let the compile running in a separate window, so that tmux doesn't need to render so much output to the visible screen, and configure some sort of monitor on the compile window so you will be notified when it is finished.
As chepner says, tmux has to send a lot more characters to update a bigger part of the screen. In my case, enabling ssh compression reduced this kind of slowness quite a lot. You can give it a try with:
ssh -C user#host
or put Compression yes into your ~/.ssh/config to make it permanent.
Question asked in June.. 2012?! ^^
If you are using X11, try a different terminal. Besides those based on xterm there are KDE's konsole and it's variants (like yakuake drop-down terminal) and GNOME's VTE and offsprings (like guake drop-down terminal :)), display update speed can be very different.
Furthermore, a rate limiting feature was implemented in march which will be in the 1.7 release out soon.

How can I have history completion / filtering when running R in Windows using the up/down arrows (like MATLAB)?

I'm used to using R in Linux, which is wonderful. However, I really need to be using Windows. I've been using Rgui.exe that comes with the R installation and the history completion feature is missing. By this, I mean that I can start to type a command and then press the up-arrow to browse through the history for commands that start with what is typed (similar to the way MATLAB handles the history).
The closest thing I've found is to use RStudio, which allows this functionality with "Ctrl+Up Arrow" (which is a livable solution). It would be nice to be able to do this with just the arrow keys and to do it in Rgui.exe or other minimal R interface. Any suggestions?
If you run R from Cygwin, you can use reverse-i-search to cycle through commands that match the given pattern and which have been executed during the current R session.
Hit CTRL-r to initiate the reverse search, then as you type the pattern to be matched against the history, the most recently executed match will dynamically appear. Keep pressing CTRL-r to cycle through the matching items.
In the example depicted below, I've initiated a reverse search for 'LET'.
Use RTerm.exe, as this includes tab completion (its very strange that RGUI on Windows doesn't, especially as the Mac GUI does).

Any method to *quickly* position the text-cursor in R for Windows in the console?

I am using R for Windows 2.9.1 (under Windows 7).
When I have a very long line in the console, sometimes I want to place the curser somewhere in the middle of the line to edit something there. But moving with the cursor keys character-by-character is very slow and annoying. For comparison: when on Unix/Linux in xterm (same as in all Windows programs I know), I use Ctrl+left/right cursor to jump from word to word, which is much better. But this dows not work for me in R for Windows! All I can do is: jump to the beginning/end of line, and move character-by-character. Pointing with the mouse to the position I want to change and clicking left does not place the text-cursor, either.
Is there any method to quickly position the text-cursor in R for Windows in the console?
I believe this is not supported in the Windows GUI. The way to go is to use an editor outside of it (like Tinn-R), which does support easy editing. By using some shortcut keys to send the code to R, this works just as efficiently, if not more so.
This also makes it easier to save your code for later reuse.

Resources