I'm setting up a terminal based programming environment, but I'm running into an issue with tmux. I need more horizontal scrolling space to view Pandas dataframes, but my horizontal screen buffer size is being restricted when I use tmux.
I've seen plenty of other answers that deal with vertical scroll-back limits, but I haven't been able to find SO answers or tmux documentation showing how to increase horizontal screen buffer size.
Below are the steps I found to increase vertical scroll distance:
1) open the tmux conf file
vim ~/.tmux.conf
2) add line to increase vertical scroll limit
set-option -g history-limit 9000
Is it possible to use a similar setting in .tmux.conf to increase horizontal scroll?
tmux adds resize-window in version 2.9, released March 26, 2019.
resize-window introduces the option to have a buffer size that is greater than the largest of the client window sizes, and takes parameters similar to the already existent resize-pane, i.e. you can either specify value for any (or both) of the height and width or you can more naturally opt to resize a window "from any of the sides".
After ensuring you are running tmux v2.9 or higher (tmux -V will tell you what version you have installed - if you need to upgrade, make sure you terminate any existing sessions to upgrade the running daemon):
To resize a window, enter tmux's command mode (default: ctrl-b followed by :) then type in resize-window followed by -x <NEW_WIDTH> or -y <NEW_HEIGHT> followed by Enter to set the width/height to an absolute value (in cells/characters).
To instead increase the existing width/height rather than specify it as an absolute value, use resize-window with one of -U, -D, -L, or -R followed by n to increase the size in the Up, Down, Left, or Right directions by n cells/characters.
e.g.
# set virtual terminal width to 2000 pixels
resize-window -x 2000
or
# increase width by 200 columns
resize-window -R 200
There is typically little benefit in increasing the height beyond the size of your actual client window as tmux already offers a huge scrollback and there's no such as vertical wraparound, but if a program requires some minimum space to e.g. layout a curses UI looks ugly at a constrained size, you can work around it with that.
If you build tmux from Git master or a 2.9-rc, you can use resize-window to set the width.
TL;DR: No.
Terminals do not normally have infinite width. Tmux specifically limits and wraps you to the horizontal and vertical size of your view. You can scroll backward through the view to see past data. You cannot scroll left and right because there is nothing to see left and right of your view; the output has been automatically adjusted to fit your view by continuing on the next line.
Based on the linked question above, screen has this capability. Tmux does not.
Edit: this answer was for tmux <2.8, which, as of this writing, was the most recent stable release. tmux 2.9 will have resize-window, see the tmux 2.9 changes file on the releases page when 2.9 is fully released
Related
I have a script which is for running as a first run script on different machines and I don't know ahead of time what the width/height of the monitors will be. What I hoping to find is a command like printf "\033[8;(width);(height)t" which is more universal and will expand the terminal to maximum no matter which size monitor is connected to the computer. I had an escape sequence that worked great, but I lost the script along with the code when one of my drives died (I know, backup, backup, and backup again) and can't seem to find that fix again anywhere.
Using the printf "\033[8;(width);(height)t" escape code sequence works if I know in advance what the height and width of the maximized monitor dimensions are (for instance using printf "\033[8;58;238t" will work on my 1920x1080 monitor just fine and will expand as expected) but it is not enough for a larger monitor. Using tput cols and tput lines will give me what the current window dimensions are, but not the maximum dimensions.
I know I can use the keyboard and mouse to do this, but I am strictly looking for something that will expand the window without any other input or key presses, if for no other reason than knowing how to do it and making it work. This needs to execute at the beginning of a bash script on a fresh Ubuntu flavor installation (the script does unique installations and updates). It might be able to work if I could figure out how to get the maximum terminal size possible of a screen into a variable to be used in the code mentioned above.
I have tried echo -ne '\e[9;1t' and printf '\e[9;1t', also echo -ne '\e[10;2t' and printf '\e[10;2t' escape codes to no avail, mentioned at https://terminalguide.namepad.de/seq/ (Control Characters and Escape Sequences) on pages "Alias: Maximize Terminal" and "Maximize Terminal Window". This is one of the few references I can find. Any searching of various ways to ask this question doesn't seem to yield any results and they all seem to rely on knowing ahead of time what the maximum dimensions can be.
Any hints of what I can use for this would be helpful, thank you.
Set the size to a number that is guaranteed to be larger than any existing screen. Pad it some to accommodate for rapidly increasing screen resolutions:
printf "\033[8;99999;99999t"
The window manager should truncate the size to the maximum available area.
I'm creating my own extension for GNOME Shell and I run into problem while searching for some documentation of Dash.
I need to find width, height, visibility and position of Dash. But I have been unsuccesful to find some doc at https://gjs-docs.gnome.org/ about Dash at all. Is there any other page, where to find these information? How to get "instance" (object with these properties) of Dash?
EDIT:
I have found that method Main.layoutManager.getWorkAreaForMonitor(0) is the one that solve my problem. It does not returns instance of Dash as I was asking for (because of that I let answer opened), but it returns work-area of screen (work area is Rectangle of monitor size, without Panel and Dash). Access x and y for get left-top corner, width and height for size without Panel and Dash. When Dash is hidding when covered by window, work-area does not take Dash in count. Btw. this is exactly what I was looking for.
I use vim to edit text files. My screen is too wide and it's cumbersome to always look near left border of screen when editing. If you open a document in MS Office, the page is "centered" instead of left-aligned, and has non-active area borders on RHS and LHS. How do I get similar behavior from vim?
Here are a couple approaches that won't work too well:
First, if you read VIM: Show a 3 character border on left of window or MacVim: how do I set a left gutter (margin) for my buffers?, you might try this:
:set foldcolumn=50
This won't work, because the maximum value of foldcolumn is limited to 12.
Second, if you read How to create a border between the line numbers and text in Vim, you might try using numberwidth instead of foldcolumn:
:set numberwidth=50
But this won't work either, because the maximum value of numberwidth is limited to 10.
The best approach that will work, as far as I've been able to find, is https://superuser.com/q/537584/376367. See that question's answer for more details, but the summary is: create two vertical splits, and edit your file in the middle. If the vertical divider lines and tildes bother you, you could hide them with:
:highlight VertSplit guifg=bg guibg=bg
:highlight NonText guifg=bg
Caution: if you use listchars, they also use NonText highlighting and will also be hidden by this trick.
A plugin which centers the text and removes distractions for you is Goyo, especially useful in combination with Limelight.
Is there any way to change the size of the text in shell script ?
I mean dynamically during the execution .
For example I have an image drawn with ASCII code and i want to reduce the size of text .
Now when echo or cat the image it will be shown as the command prompt actual size (the actual font size) .
A couple of comments note that font size/style are under the control of the terminal emulator, and that xterm (and a few others) support escape sequences to change these.
However - almost all terminal emulators (all that you would be likely to encounter) rely upon keeping the characters in a nice row/column grid. All of the characters have the "same" size. If you change the size of the font in xterm, all of the characters on the screen change to the same size. So there is no way to (as OP asks) to reduce the font-size temporarily, e.g., while using ASCII graphics to draw a picture using aalib, etc.
If you want to do something like that, the easiest way to do it is to have the script run its graphics in a separate window, e.g., by splitting it up into one part that starts the window and another script to draw the graphics.
For an alternate via of terminals and fonts, there is always something like 9term (no rows, no columns, no vi).
How does one use xmonad with the physical screens in portrait orientation?
I have two physical displays and they are both rotated 90 degrees to the right (clockwise with original bottom edges on the left)
I'm on Fedora 21 (3.19.3-200.fc21.x86_64)
I don't know how to tell what window manager is running, but there's a gnome-shell process running...
When I sudo telinit 3 and then startx, xmonad comes up with everything in landscape orientation. I don't know how to change it at that point and I don't know how to make it start in portrait mode.
My .xinitrc file says this
#!/usr/bin/env bash
emacs &
gnome-terminal &
exec xmonad
Thanks in advance for any help!
Well, first of all, your window manager seems to be xmonad ;-).
Independent of that, xrandr does what you need.
Shamelessly taken from here (because SO doesn't accept duplicates from unix.stackexchange.com):
Find your output devices with xrandr (the first word before "connected", you should find two such lines), e.g. eDP1 if the output is
eDP1 connected 1600x900+0+0 (normal left inverted right x axis y axis) 309mm x 174mm
and then have fun with
xrandr --output eDP1 --rotate right
in your .xinitrc.
The original answer notices that by using a NVidia card you may have to add
Option "RandRRotation" "True"
to your xorg.conf (which i cannot verify with my setup).