How to resize a tmux
window
Summary
This article explains how to resize (maximize or minimize) a tmux
window using resize-window -A
and other options, including manual size adjustments with directional parameters.
Introduction #
When using tmux
, a terminal multiplexer that allows multiple terminal sessions in a single window, you may need to resize or maximize a window to fit the largest available space.
This article explains how to force tmux
to resize a window, including maximizing it and adjusting dimensions manually. Whether you need a fullscreen experience or precise resizing, these options provide full control over your tmux
environment.
The <C-b>
key refers to the defined leader key in tmux
.
Maximize the tmux
window #
To maximize a tmux
window, you can use the following command:
<C-b>:resize-window -A
This command grows the window to the largest size possible, based on the constraints of the currently connected session. It ensures that the window takes up the maximum available space within the tmux
environment.
Using resize-window
with other parameters #
If you need more control over resizing, the resize-window
(or resizew
) command provides multiple options. These allow you to adjust the window size in various ways.
Resize to the smallest session (minimize) #
To resize the tmux
window to match the smallest connected session, use:
<C-b>:resize-window -a
This ensures that the window does not exceed the constraints of the smallest session attached to tmux
.
Adjusting window size manually #
You can manually resize the tmux
window using directional adjustments:
Move up (shrink height):
<C-b>:resize-window -U <number>
Move down (grow height):
<C-b>:resize-window -D <number>
Move left (shrink width):
<C-b>:resize-window -L <number>
Move right (grow width):
<C-b>:resize-window -R <number>
The <number>
specifies how many rows or columns to adjust in the given direction.
Growing and shrinking the window #
To expand the window size:
Increase height:
<C-b>:resize-window -D <number>
Increase width:
<C-b>:resize-window -R <number>
To shrink the window size:
Decrease height:
<C-b>:resize-window -U <number>
Decrease width:
<C-b>:resize-window -L <number>
Setting specific width and height #
You can also specify an exact window size in tmux
using:
<C-b>:resize-window -x <width> -y <height>
Replace <width>
and <height>
with the desired pixel dimensions.
Further readings #
Sources and recommended, further resources on the topic:
License
How to resize a tmux
window by Jonas Jared Jacek is licensed under CC BY-SA 4.0.
This license requires that reusers give credit to the creator. It allows reusers to distribute, remix, adapt, and build upon the material in any medium or format, for noncommercial purposes only. To give credit, provide a link back to the original source, the author, and the license e.g. like this:
<p xmlns:cc="http://creativecommons.org/ns#" xmlns:dct="http://purl.org/dc/terms/"><a property="dct:title" rel="cc:attributionURL" href="https://www.ditig.com/how-to-resize-a-tmux-window">How to resize a tmux
window</a> by <a rel="cc:attributionURL dct:creator" property="cc:attributionName" href="https://www.j15k.com/">Jonas Jared Jacek</a> is licensed under <a href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank" rel="license noopener noreferrer">CC BY-SA 4.0</a>.</p>
For more information see the Ditig legal page.