Keith Lyons
Keith Lyons

Reputation: 614

How to increase horizontal buffer in tmux pane

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?

Upvotes: 5

Views: 3375

Answers (3)

Mahmoud Al-Qudsi
Mahmoud Al-Qudsi

Reputation: 29519

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.

Upvotes: 5

jeremysprofile
jeremysprofile

Reputation: 11425

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

Upvotes: 0

user11274868
user11274868

Reputation:

If you build tmux from Git master or a 2.9-rc, you can use resize-window to set the width.

Upvotes: 3

Related Questions