1. Overview
Sometimes, we may want to adjust the zoom level within the terminal to improve readability and productivity. Specifically, we can perform this operation when working with lengthy lines of code, analyzing detailed user logs, or enhancing the overall user experience.
In this tutorial, we’ll check out different methods for zooming the terminal in Linux using keyboard shortcuts, terminal emulator menu options, and third-party tools like xdotool and xzoom.
Notably, the examples involve zooming the default terminal on a Ubuntu 22.04 GNOME desktop.
2. Using Keyboard Shortcuts
In Linux, different keyboard shortcuts enable us to adjust the zoom level in the terminal. Specifically, we can use such key combinations to zoom in, zoom out, and reset the zoom level of a terminal emulator.
For instance, let’s press the CTRL and + keys simultaneously to zoom in on the terminal:
Thus, we see the terminal in a zoomed-in view that the CTRL and + keys enabled.
Now, in the same terminal, we press the CTRL and 0 keys together to set the zoom level back to its default value:
As a result, we can see the terminal at 100% zoom level.
Now, let’s press the CTRL and – keys to zoom out the terminal:
Consequently, we immediately see the terminal in a zoomed-out view.
3. Using Terminal Menu Options
Some terminal emulators provide built-in options to adjust the font size or set the zoom level through their menu. In particular, the default GNOME terminal of Linux also offers such menu options.
For instance, in the terminal window, we open the three-dash menu and click the zoom-in magnifying glass option:
Thus, the menu option successfully increases the font size in the terminal.
Now, let’s set the zoom level to 100% using the second option of the terminal menu:
As a result, we see the terminal at 100% zoom level.
Now, we click the zoom-out magnifying glass menu option to zoom out from the terminal.
Let’s check the result:
Consequently, we see the terminal in a more zoomed-out view.
4. Using Third-Party Tools
In Linux, we can also use third-party tools like xdotool and xzoom for setting the zoom level of the terminal.
4.1. Using the xdotool Utility
xdotool is a command-line utility for automating different repetitive tasks and controlling GUI applications from the command line. Additionally, we can use it to simulate keyboard shortcuts, such as those for zooming in the terminal.
To do so, first, we install the xdotool on the system:
$ sudo apt install xdotool
After finishing the installation process, we use xdotool with the key option to simulate the keyboard shortcut for zooming in:
$ xdotool key Ctrl+plus
Let’s check the result:
Thus, we see the terminal in a zoomed-in view.
Similarly, we can now specify the Ctrl+0 key in the xdotool command to reset the zoom level:
$ xdotool key Ctrl+0
The result is as expected:
Consequently, we see the terminal zoom level set to 100%.
Now, let’s pass Ctrl+minus as the key to xdotool to zoom out from the terminal:
$ xdotool key Ctrl+minus
Let’s check the result:
Thus, the simulated key shortcut decreases the zoom level of the terminal.
4.2. Using the xzoom Tool
xzoom is a tool specifically used to zoom in on parts of the screen. It provides a resizeable window that magnifies a portion of the screen, which makes it easier to see details.
Moreover, we can use it to magnify and view the terminal output.
For this, first, we install the xzoom tool on the system:
$ sudo apt install xzoom
After a successful installation, we open the xzoom tool from the terminal:
$ xzoom
Here, we use the magnifier of xzoom and hover it over the terminal output:
Thus, we successfully zoomed in on certain parts of the terminal using the xzoom utility.
The benefit of xzoom is that it works on any window, not only terminals.
5. Conclusion
In this article, we learned different methods to zoom in and out within the terminal.
We saw that keyboard shortcuts such as CTRL and +, CTRL and –, and CTRL and 0 zoom in, zoom out, and reset the zoom level to 100%. Furthermore, we explored third-party tools, such as xdotool and xzoom, to apply the same zoom-level settings using the command line. On the other hand, we use the terminal menu options to perform the operations through the GUI.
Ultimately, we can choose any of these methods based on our preferences.