From dc55671191421a60ab2895cc57213175d6f4a985 Mon Sep 17 00:00:00 2001 From: phact Date: Tue, 28 Oct 2025 13:26:40 -0400 Subject: [PATCH 1/4] windows check --- src/tui/main.py | 9 +++++++++ src/tui/screens/diagnostics.py | 19 +++++++++++++++++++ src/tui/utils/platform.py | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+) diff --git a/src/tui/main.py b/src/tui/main.py index 51418786..5ddd089c 100644 --- a/src/tui/main.py +++ b/src/tui/main.py @@ -368,6 +368,15 @@ class OpenRAGTUI(App): def on_mount(self) -> None: """Initialize the application.""" + # Check if running on native Windows and recommend WSL + if self.platform_detector.is_native_windows(): + notify_with_diagnostics( + self, + "Running on native Windows. For best experience, use WSL. See diagnostics for details.", + severity="warning", + timeout=15, + ) + # Check for runtime availability and show appropriate screen if not self.container_manager.is_available(): notify_with_diagnostics( diff --git a/src/tui/screens/diagnostics.py b/src/tui/screens/diagnostics.py index bad456e4..a01ae302 100644 --- a/src/tui/screens/diagnostics.py +++ b/src/tui/screens/diagnostics.py @@ -15,6 +15,7 @@ from rich.text import Text from ..managers.container_manager import ContainerManager from ..utils.clipboard import copy_text_to_clipboard +from ..utils.platform import PlatformDetector class DiagnosticsScreen(Screen): @@ -52,6 +53,7 @@ class DiagnosticsScreen(Screen): def __init__(self): super().__init__() self.container_manager = ContainerManager() + self.platform_detector = PlatformDetector() self._logger = logging.getLogger("openrag.diagnostics") self._status_timer = None @@ -199,6 +201,23 @@ class DiagnosticsScreen(Screen): """Get system information text.""" info_text = Text() + # Platform information + info_text.append("Platform Information\n", style="bold") + info_text.append("=" * 30 + "\n") + info_text.append(f"System: {self.platform_detector.platform_system}\n") + info_text.append(f"Machine: {self.platform_detector.platform_machine}\n") + + # Windows-specific warning + if self.platform_detector.is_native_windows(): + info_text.append("\n") + info_text.append("⚠️ Native Windows Detected\n", style="bold yellow") + info_text.append("-" * 30 + "\n") + info_text.append(self.platform_detector.get_wsl_recommendation()) + info_text.append("\n") + + info_text.append("\n") + + # Container runtime information runtime_info = self.container_manager.get_runtime_info() info_text.append("Container Runtime Information\n", style="bold") diff --git a/src/tui/utils/platform.py b/src/tui/utils/platform.py index 176c60c6..ff7805bf 100644 --- a/src/tui/utils/platform.py +++ b/src/tui/utils/platform.py @@ -30,6 +30,15 @@ class PlatformDetector: self.platform_system = platform.system() self.platform_machine = platform.machine() + def is_native_windows(self) -> bool: + """ + Check if running on native Windows (not WSL). + + Returns True if running on native Windows, False otherwise. + WSL environments will return False since they identify as Linux. + """ + return self.platform_system == "Windows" + def detect_runtime(self) -> RuntimeInfo: """Detect available container runtime and compose capabilities.""" # First check if we have podman installed @@ -166,6 +175,26 @@ class PlatformDetector: ) as e: return False, 0, f"Error checking Podman VM memory: {e}" + def get_wsl_recommendation(self) -> str: + """Get recommendation message for native Windows users to use WSL.""" + return """ +⚠️ Running on native Windows detected. + +For the best experience, we recommend using Windows Subsystem for Linux (WSL). + +To set up WSL: + 1. Open PowerShell or Command Prompt as Administrator + 2. Run: wsl --install + 3. Restart your computer + 4. Set up your Linux distribution (Ubuntu recommended) + 5. Install Docker or Podman in WSL + +Learn more: https://docs.microsoft.com/en-us/windows/wsl/install + +Alternatively, you can use Docker Desktop for Windows: + https://docs.docker.com/desktop/install/windows-install/ +""" + def get_installation_instructions(self) -> str: if self.platform_system == "Darwin": return """ @@ -200,6 +229,10 @@ Docker Desktop for Windows: Or Podman Desktop: https://podman-desktop.io/downloads + +For better performance, consider using WSL: + Run: wsl --install + https://docs.microsoft.com/en-us/windows/wsl/install """ else: return """ From ceb426e1c0c1ac4db8a0b0c576405350af4ad4ce Mon Sep 17 00:00:00 2001 From: phact Date: Tue, 28 Oct 2025 13:59:19 -0400 Subject: [PATCH 2/4] exit --- src/tui/main.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/tui/main.py b/src/tui/main.py index 5ddd089c..417279c9 100644 --- a/src/tui/main.py +++ b/src/tui/main.py @@ -368,14 +368,15 @@ class OpenRAGTUI(App): def on_mount(self) -> None: """Initialize the application.""" - # Check if running on native Windows and recommend WSL + # Check if running on native Windows and exit if self.platform_detector.is_native_windows(): - notify_with_diagnostics( - self, - "Running on native Windows. For best experience, use WSL. See diagnostics for details.", - severity="warning", - timeout=15, - ) + print("\n" + "=" * 60) + print("⚠️ Native Windows Not Supported") + print("=" * 60) + print(self.platform_detector.get_wsl_recommendation()) + print("=" * 60 + "\n") + self.exit(1) + return # Check for runtime availability and show appropriate screen if not self.container_manager.is_available(): From a9ac9d089411c5478c1eb0ddb2dd9a8bf0fd65bd Mon Sep 17 00:00:00 2001 From: phact Date: Tue, 28 Oct 2025 14:02:13 -0400 Subject: [PATCH 3/4] message --- src/tui/main.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/tui/main.py b/src/tui/main.py index 417279c9..e0f60df2 100644 --- a/src/tui/main.py +++ b/src/tui/main.py @@ -368,16 +368,6 @@ class OpenRAGTUI(App): def on_mount(self) -> None: """Initialize the application.""" - # Check if running on native Windows and exit - if self.platform_detector.is_native_windows(): - print("\n" + "=" * 60) - print("⚠️ Native Windows Not Supported") - print("=" * 60) - print(self.platform_detector.get_wsl_recommendation()) - print("=" * 60 + "\n") - self.exit(1) - return - # Check for runtime availability and show appropriate screen if not self.container_manager.is_available(): notify_with_diagnostics( @@ -507,6 +497,18 @@ def copy_compose_files(*, force: bool = False) -> None: def run_tui(): """Run the OpenRAG TUI application.""" + # Check for native Windows before launching TUI + from .utils.platform import PlatformDetector + platform_detector = PlatformDetector() + + if platform_detector.is_native_windows(): + print("\n" + "=" * 60) + print("⚠️ Native Windows Not Supported") + print("=" * 60) + print(platform_detector.get_wsl_recommendation()) + print("=" * 60 + "\n") + sys.exit(1) + app = None try: # Keep bundled assets aligned with the packaged versions From 6b71fe4f69d746afdb6110d950d702698a27f7d5 Mon Sep 17 00:00:00 2001 From: phact Date: Tue, 28 Oct 2025 14:04:09 -0400 Subject: [PATCH 4/4] copy --- src/tui/utils/platform.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/tui/utils/platform.py b/src/tui/utils/platform.py index ff7805bf..5b2edbab 100644 --- a/src/tui/utils/platform.py +++ b/src/tui/utils/platform.py @@ -190,9 +190,6 @@ To set up WSL: 5. Install Docker or Podman in WSL Learn more: https://docs.microsoft.com/en-us/windows/wsl/install - -Alternatively, you can use Docker Desktop for Windows: - https://docs.docker.com/desktop/install/windows-install/ """ def get_installation_instructions(self) -> str: