相关疑难解决方法(0)

使用多个选项卡和不同的命令打开新的 gnome-terminal (v3.28+)

gnome-terminal 的行为似乎在 Ubuntu 14 (v3.6?) 和 Ubuntu 18 (v3.28) 附带的版本之间发生了变化。

我有一个脚本,它打开一个新的 gnome-terminal,其中有一堆选项卡设置到不同的目录以供我的开发,目前第一个选项卡运行一个脚本。使用选项卡打开 gnome 终端的命令如下所示:

gnome-terminal \
   --tab --command="myscript.sh" \
   --tab --working-directory="<some dir 1>" \
   --tab --working-directory="<some dir 2>" \
   ...
Run Code Online (Sandbox Code Playgroud)

这在 Ubuntu 14 (v3.6?) 附带的 gnome-terminal 版本中可以完美地工作。

但是在 Ubuntu 18 (v3.28) 附带的 gnome-terminal 版本中,有几件事发生了变化:

  1. 除非我添加该--window选项,否则选项卡会在当前的 gnome 终端中打开,而不是新的。不幸的是,添加该--window选项会打开一个初始空白选项卡。是否可以仅使用我指定的选项卡打开一个新窗口?
  2. 我现在收到以下通知(尽管它的功能和以前一样):

    # Option “--command” is deprecated and might be removed in a later version of gnome-terminal.
    # Use “-- ” to terminate the options and put the command line …
    Run Code Online (Sandbox Code Playgroud)

linux gnome gnome-terminal

8
推荐指数
1
解决办法
3642
查看次数

标签 统计

gnome ×1

gnome-terminal ×1

linux ×1