Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

It used to be that Ctrl + - and Ctrl + + would increase or decrease the text size of the terminal in earlier versions of Ubuntu, which is helpful when you're giving presentations and want to show your code in a larger size. I switched to Xubuntu 12.04, and I'm missing these keyboard shortcuts.

Is there an alternative I can use? Or if not, is there a way I can define my own shortcut to replace these?

share|improve this question
up vote 5 down vote accepted

Instead of relying on Python and missing modules, as in Noah K. Tilton's github solution, I drafted up a bash script that's a step closer to being more portable (at least, for installations using the most generic, default paths).

You may need to tweak the script to setup your xfce configuration path, your favourite font, etc.

Just 2 files, dropped into my home's ~/bin folder, "zoomin" and "zoomout". I didn't go further than making short commands that I can type quickly, so I don't have a clue how I'd be able to configure these scripts to respond ONLY when I'm inside of xfce4-terminal -- meaning that I gave up thinking about how to get the keybindings made for Ctrl+- and Ctrl++ because I currently only know about global keyboard bindings and didn't want to override those Keypress Combos since other applications will need them (ex: web browser, text editor).

I also thought about having "zoommin" and "zoommax", to jump to my smallest and biggest fonts when needed, typically when I need to see tons of text VS when I need to show a colleague something on my screen. I'll leave those two scripts up to your imagination on how to create :P


SIZE=`grep 'FontName' ~/.config/xfce4/terminal/terminalrc | cut -d' ' -f 2`
REGEXPR='s/FontName.*/FontName=Monospace '$NEWSIZE'/g'
sed -i "$REGEXPR" ~/.config/xfce4/terminal/terminalrc


SIZE=`grep 'FontName' ~/.config/xfce4/terminal/terminalrc | cut -d' ' -f 2`
REGEXPR='s/FontName.*/FontName=Monospace '$NEWSIZE'/g'
sed -i "$REGEXPR" ~/.config/xfce4/terminal/terminalrc
share|improve this answer
Not sure I follow what you mean by "missing modules" - my python script uses the standard library. I think bash/python portability is a toss-up. However, yours might be more performant - at the cost of some readability. – g33kz0r Mar 10 '14 at 16:51
I experienced this among other things. Noah K was, all fairness granted, against tweaking his script to make life easier for *buntu users. I simply reverse-engineered the thing to be a little more universal, removing the python requirement altogether. :3 – starlocke Mar 10 '14 at 20:09
you reported a bug on XDG_CONFIG_PATH - a string that doesn't appear in my script. Huh? Assuming you meant XDG_CONFIG_HOME, which does appear in my script, you might want to check out… which basically says it's up to the user to define it. Not sure what the "other things" were :) Opinions may differ, but I think 1 parameterized python script is a little cleaner than 2 bash scripts. – g33kz0r Mar 10 '14 at 22:29
it it's about a short readable text change I would suggest perl perl -pi -e 's/(FontName.*)(\d+)/$1.($2+2)/e' ~/.config/xfce4/terminal/terminalrc rather than fiddling with the bash – Hachi Sep 26 '14 at 7:48
Cool, based on this, I created three methods which I add in my ~/.bash_aliases file: zi, zo and z, which each takes as first argument either steps to zoom (zi and zo), or destination font size (z): . So, to set text size to 12, I would do z 12, and to zoom in one step, I would do zi 1. – Samuel Lampa Oct 3 '14 at 14:55

The shortcuts you mention are for gnome-terminal, the default terminal used by gnome (and, what follows, by standard Ubuntu). XFCE, which is the main environment in Xubuntu, has its own terminal implementation. However, as far as I can tell, it is not possible in xfce4-terminal to change the font size with a shortcut (you can see the list of possible shortcuts when you go to Edit->Preferences->Shortcuts).

If you rely on this feature, you can install gnome-terminal, but since the whole point of using XFCE is often that it does not involve the somewhat heavy Gnome libraries, this might be a little unproductive.

share|improve this answer
Thanks for the answer. How disappointing, though! :( – John Feminella Oct 8 '12 at 15:00
Well, XFCE is supposed to be lean and fast, so naturally they had to give up on features. – January Oct 8 '12 at 15:02
@January I think your answer sells this question a bit short, please see my answer below. – g33kz0r May 30 '13 at 7:20
@g33kz0r nah, starlocke (the accepted answer) made already a good case. – January Mar 10 '14 at 9:38
@January, well that was posted after my answer :) – g33kz0r Mar 10 '14 at 16:50

It is possible, though not through xfce4 proper, using this workaround:

(requires python).

I use it in awesome window manager like this:

awful.key({ "Control", "Shift" }, "Up", function () awful.util.spawn(script_dir .. "/xfce4-terminal-font +", false)end),
awful.key({ "Control", "Shift" }, "Down", function () awful.util.spawn(script_dir .. "/xfce4-terminal-font -", false)end),

It's a bit of a hack, but it works.

share|improve this answer
This has the same drawback as the answer from @starlocke (who also mentioned that it is Noah's solution): it creates a windowmanager shortcut, not a terminal shortcut. Since ctrl-shift-up or ctrl-shift-down are fairly common key combinations (not to mention the more typical ctrl + and ctrl - shortcuts used to change font size for example in gnome-terminal), it might lead to shortcut collisions and / or lack of consistency. – January Mar 10 '14 at 9:39
All true ... but I don't think collision is that big of a deal - if it collides, just change the shortcut ... I would also note that OP didn't ask for a terminal shortcut - he just asked generally how to do it - and your answer that "it is not possible in xfce4-terminal to change the font size with a shortcut" is inaccurate. – g33kz0r Mar 10 '14 at 16:53

The following script checks if Xfce4 Terminal is running. If it is not, the script exits. This script uses arguments, script-name --in to zoom in and script-name --out to zoom out. It will work for any font type. (Different font types have a different number of words.)

I named my script terminal-zoom, and I am using Ctrl Alt + for terminal-zoom --in and Ctrl Alt - for terminal-zoom --out.


# Check if Xfce4 Terminal is running. If it is not, exit.
status=$(pgrep xfce4-terminal)

if [ -z "$status" ]; then
    notify-send "No Xfce4 Terminal session is open."
    exit 1

# 1. Get the full line. 2. Get the entire line minus font size. 3. Get only font size. 
line=$(grep "FontName" ~/.config/xfce4/terminal/terminalrc)
font_name=$(echo "$line" | sed s/'\w*$'//)
font_size=$(echo "$line" | grep -oE '[^ ]+$')

# Increase or decrease font size. You might want to change this to increase and decrease by two.
if [ "$1" = "--in" ]; then
    new_size=$((font_size + 1))
elif [ "$1" = "--out" ]; then
    new_size=$((font_size - 1))
    notify-send "Argument options: --in --out"
    exit 1

# Replace the line with the new font size.
sed -i "$action" ~/.config/xfce4/terminal/terminalrc

# Show the new current font being used.
notify-send -t 200 "$new_size pt font"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.