How to Add Padding to the Ubuntu Terminal

How to Add Padding to the Ubuntu Terminal
Photo by Gabriel Heinzer / Unsplash

By default the Ubuntu terminal doesn't have any padding around the text. In this example you can see what the terminal looks like with 10px of padding around the green text.

I couldn't find a way to do this in the settings, but you can modify a CSS file to change the appearance of the terminal, if you're using the Gnome terminal, which Ubuntu uses by default.

screenshot of ubuntu terminal with padding.

How to modify the CSS

Check if the file exists

In a terminal run the following command:

ls ~/.config/gtk-3.0/gtk.css

The gtk.css file is the CSS file which will handle the styling for the terminal.

If the file doesn't exist, create it with:

touch ~/.config/gtk-3.0/gtk.css

Editing the file

Open the file in your favourite text editor, such as Visual Studio Code or in this case Vim. Add the following CSS and save the file:

 vte-terminal {
     padding: 10px 10px 10px 10px;
     -VteTerminal-inner-border: 10px 10px 10px 10px;

Close any running instances of the terminal, and then re-open it to check the changes have taken effect. If not you may need to restart before you see the changes.