For at least a couple of years, gnome-terminal has had the following annoying bug: if you maximize the window and then unmaximize it, the window ends up smaller than it began. There’s a discussion by the Gnome developers here. It doesn’t look like this bug will be fixed any time soon.
Below is a shell script to work around this problem. It resets the size of the current window to whatever you have specified in the default profile of your gnome-terminal preferences. You’ll need to install the “xterm-resize” package for the resize
program.
#!/bin/sh
profile="$( dconf dump /org/gnome/terminal/legacy/profiles:/ |
grep '^default=' |
sed "s/^[^']*'\([^']*\)'.*$/\1/" )"
rows_cols="$( dconf dump /org/gnome/terminal/legacy/profiles:/:"$profile"/ |
awk -F '=' '/^default-size-columns/ { cols = $2 }
/^default-size-rows/ { rows = $2 }
END { print rows, cols }' )"
resize -s $rows_cols >/dev/null