如何检测当前桌面环境中使用的是哪个终端模拟器(xterm,gnome-terminal...)?像xdg-open,但用于终端模拟器。
我已经xdg-terminal在我的 Xubuntu 安装上尝试过这个脚本,但没有成功:
./xdg-terminal.sh: 305: [: x: unexpected operator
./xdg-terminal.sh: 399: [: xxterm: unexpected operator
xdg-terminal: configured terminal program 'xterm' not found or not executable
Run Code Online (Sandbox Code Playgroud)
它将用于在 C++ 程序中使用,因此任何脚本、包或内置命令都可以。
谢谢您的帮助 !