本文介绍了如何从命令行在GNOME终端中打开新选项卡?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Ubuntu 9.04 x64,并且在我撰写本文时:
I'm using Ubuntu 9.04 x64 and when I write:
gnome-terminal --tab
在终端,我希望它在同一终端窗口中打开一个新选项卡.而是打开了一个新窗口.
At the terminal, I expect it to open a new tab in the same terminal window. But it opens a new window instead.
我发现它的目的是在新窗口中打开一个新标签,即如果我写:
I found out that its intention is to open a new tab in a new window, i.e., if I write:
gnome-terminal --tab --tab
它将打开一个带有两个标签的新窗口.
It will open a new window with two tabs.
所以问题是,如何使用 gnome-terminal
中的命令在 current 窗口中打开新标签页?
So, the question is, how can I open a new tab in the current window using a command in gnome-terminal
?
推荐答案
#!/bin/sh
WID=$(xprop -root | grep "_NET_ACTIVE_WINDOW(WINDOW)"| awk '{print $5}')
xdotool windowfocus $WID
xdotool key ctrl+shift+t
wmctrl -i -a $WID
这将自动确定相应的终端并相应地打开选项卡.
This will auto determine the corresponding terminal and opens the tab accordingly.
这篇关于如何从命令行在GNOME终端中打开新选项卡?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!