Fix headless mode: use sleep loop instead of CLI mode (prevent EOF exit)
- Headless now keeps server alive with asyncio.sleep(1) loop - CLI mode only for non-headless fallback - Enables running SenSu as daemon/service
This commit is contained in:
@@ -333,7 +333,11 @@ class SenSuFramework:
|
||||
|
||||
# 特殊终端,添加命令行输入处理
|
||||
tui = self.service_manager.get_service("tui")
|
||||
if self.headless or not hasattr(tui, 'tui_app'):
|
||||
if self.headless:
|
||||
while self.is_running:
|
||||
try: await asyncio.sleep(1)
|
||||
except asyncio.CancelledError: break
|
||||
elif not hasattr(tui, 'tui_app'):
|
||||
await self._run_cli_mode()
|
||||
else:
|
||||
# 原有的TUI模式
|
||||
|
||||
Reference in New Issue
Block a user