检查源代码(vte和gnome终端),看起来没有办法做到这一点。其他终端(例如xterm)可以使用转义序列来完成此操作。看见
XTerm Control Sequences
:
OSC Ps ; Pt ST
Set Text Parameters. For colors and font, if Pt is a "?", the
control sequence elicits a response which consists of the con-
trol sequence which would set the corresponding value. The
dtterm control sequences allow you to determine the icon name
and window title.
...
Ps = 5 0 -> Set Font to Pt. These controls may be disabled
using the allowFontOps resource. If Pt begins with a "#",
index in the font menu, relative (if the next character is a
plus or minus sign) or absolute. A number is expected but not
required after the sign (the default is the current entry for
relative, zero for absolute indexing).
vte识别
50
,但这(像许多其他xterm特性一样)只是一个不起任何作用的存根。xterm源包括
20-year old script
这演示了该功能(请参见
fonts.sh
).
wmctrl
工具(可询问
窗口管理器
与码头谈判)。一些人已经用其他终端实现了这一点,例如,
terminology
职业教育
做
有一些可以从python脚本访问的代码,使用
g_signal_connect
联想
decrease-font-size
和
increase-font-size
信号(见
source code
signal code
就是你正在使用的键盘。但是,如何从终端仿真器外部启动的脚本确定对象指针还不清楚。