1

我之前找到了这个解决方案,但它一直在尝试启动 xterm 而不是默认的(在我的情况下是终结者)。有人可以帮忙吗?

def terminal(self):
    if sys.platform.startswith('linux'):
        os.system('(cd .;$TERM; )'.format(self.dirname))
    elif sys.platform.startswith('win'):
        os.system('start /d {0} cmd'.format(os.path.normpath(self.dirname)))
4

2 回答 2

1

TERM是终端能力,与实际终端程序没有太大关系。

存储默认值没有标准,它完全取决于您使用的发行版..

它可能是

  • 在 /etc/alternatives 中,可能/etc/alternatives/x-terminal-emulator
  • 用 gnome,试试gsettings get org.gnome.desktop.default-applications.terminal

注意:没有尝试过这些......

于 2013-05-06T18:06:57.960 回答
0

这取决于外壳。在 Xfce 中是exo-open --launch TerminalEmulator. 在 GNOME 中是x-terminal-emulator.

于 2013-05-06T18:07:47.393 回答