Prevent tmux from printing line numbers - tmux

I am scrolling back in Tmux using the key combination + [, and as I scroll up, I see this on the right hand side.
What is this feature even called? It's extremely frustrating because it interrupts my data as I see it on the screen.

The line number should remain in the top line only and not appear on any lower lines, if that is what is happening (it is not entirely clear from your picture). If it does appear on lower lines I suggest you make sure your tmux version is up to date, make sure TERM outside tmux is correct for your terminal and perhaps try a different terminal entirely and see if it happens there too.

Related

R: Is there a way to set the terminal interpreter to allow line wrapping instead of cutting off with a dollar sign ($)?

When using the R interpreter from the terminal/command line, a line of code longer than 75 characters gets cut off from view with a preceding $ sign, as shown here. Both pictures are different views of the same line of code.
(I know the whole command is there and I can use the arrow keys/home/end to go through it.)
This makes the interpreter harder to use when pressing "up" to rerun previous lines of code with one or two small changes, since I have to scroll through the line to find the right spot. It'd be easier if I could just see the whole line. It's also a bit silly since my usable screen area is much wider than 75 characters. Is there a setting I can modify so that the lines will wrap, or at least allow them to be longer before getting cut off?

Make Octave set a figure to be the active window (come to the "front of the screen")

When Octave draws a plot, I would like it to set that to be the active window automatically, so that it becomes visible and I don't have to click back and forth between windows to see if the code and plot have finished. Is this possible? Since it would require reaching outside of Octave and controlling the OS, I'm not sure; it depends on whether or not that capability is part of Octave but I haven't found a reference for it yet.
I can always tell Octave to close the figure before opening a new one in the code, but that could prevent me from drawing multiple plots on the same axes, and it would require me to code that command in every time. It would be nice if there were a direct way just to bring the plot to be visible and take dominance over other windows.
EDIT: Somehow, although I noted that Octave would be required to control the OS to achieve this, I completely forgot to mention what that was... I'm running Windows 10 with the default window manager; I believe that would be the Desktop Window Manager.
When you plot something on a figure (whether you specify the figure you're plotting to within the plot command explicitly or simply let it plot into the currently active figure implicitly), this does not automatically raise the figure window to the forefront.
To do so, call the figure again using the figure function, along with the handle that you want to raise.
Alternatively, if you're sure that the figure you want to raise is the currently active one, you can simply use the shg command (which is effectively equivalent to figure(gcf))
E.g.
Fig1 = figure; % (or figure(1) if you want to be explicit)
Fig2 = figure; % (or figure(2) if you want to be explicit)
figure(Fig1); plot(1:10); % raise Fig1 to the forefront, and plot.
PS: Note that there was a bug affecting this behaviour until recently (coincidentally submitted by yours truly :p See https://savannah.gnu.org/bugs/?45943 ). This is fixed in the latest version of octave though (i.e. 5.1.0)

Add shortcut to section of long R script?

I have a very long script with more than 5000 lines and I was wondering if I could add shortcuts to sections of the script.
I have separated my script into validation, prediction and figures. I would like to have little shortcut/link at the beginning of the script, so someone that wants to have a look at a part of my script doesn't have to scroll down.
Does anybody knows if such things exist?
In RStudio, if you put four #'s on each side of a comment on its own line, RStudio will mark it as a section that can be navigated to by clicking on it at the bottom of the source code window. It should read 'Top Level' by default.
Example:
#### Calculate standard deviation and moving average ####

In the less pager, is there a way to show more lines before a search result?

I often search within less, but it puts the search result to the very top of the screen, which makes reading man pages difficult, since I'm searching for a word, but I really want to see the flag connected to that description, which might be a few lines up.
Is there a way to show more lines at the top of the screen, so that the cursor is something like 5-10 lines below the top of the screen? Something like vim's scrolloff option.
Sounds like you want the -j option. For example, less -j5 would put a search result on line 5.
For man you'll need to set the PAGER environment variable to include the -j.
To show more lines of context before the search result, i.e. to place the search result a few lines down from the top of the screen instead of the top line, use:
less -jX
where X is the number of lines below the top of the screen where you want your results to end up.
If you usually prefer this style of search results, and want less to use it all the time (for example in man), put the option in the $LESS environment variable. For example, to always place the search result 5 lines down, using bash, that will be:
export LESS=-j5
You can of course add any other options to less in the $LESS environment variable too if you like.

plotting very long time series - scroll bars?

I have a very long time series of data to plot, and if I "zoom in" enough to see the interesting features, I can only look at a very small section of the data, and must replot every time I want to look at a different time window.
What I would like is a solution that gives me a graph with a horizontal scroll bar so I can browse around within the long time series.
My current preferred solution is gnuplot/aquaterm on OS X. It doesn't appear that this can do what I want - I can specify "set size 2.0,1.0" but this just causes the graph to spill over the window bounds, without causing a scroll bar to appear.
Can anybody recommend a solution that will do what I want - preferably with gnuplot, but any solution would do. I could of course write my own gnuplot gui terminal (or mess around with aquaterm), but I don't unfortunately have time for that!
Thanks for any suggestions.
Jonny
If you use an image terminal you can make it arbitrarily wide:
set terminal png size [width]x[height]
set output '[fname].png
Then open the output png file in an image viewer that scrolls.

Resources