代码拉取完成,页面将自动刷新
From f2763aaed8f421bcf266a3122a84c41a7441a5d9 Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Mon, 11 Dec 2023 16:29:02 -0500
Subject: [PATCH] tuna: Don't start the gui if a display is not available
This is intended for the getopt branch of tuna
Don't start the gui if a display is not available.
Signed-off-by: John Kacur <jkacur@redhat.com>
---
tuna-cmd.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tuna-cmd.py b/tuna-cmd.py
index 38e7017336a5..ff2920f06d6f 100755
--- a/tuna-cmd.py
+++ b/tuna-cmd.py
@@ -821,6 +821,12 @@ def main():
sys.exit(2)
if run_gui:
+ # Don't try to start the gui if no display is available
+ display = os.getenv("DISPLAY")
+ if not display:
+ usage()
+ return
+
try:
from tuna import tuna_gui
except ImportError:
--
2.42.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。