From 730f2eb37a3074238f0b4c815dda8723c3bf0bb1 Mon Sep 17 00:00:00 2001 From: Greg Hendrickson Date: Tue, 27 Jan 2026 18:14:04 +0000 Subject: [PATCH] fix: use simple menu directly (Textual over SSH unreliable) --- src/shellmate/ssh/server.py | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/src/shellmate/ssh/server.py b/src/shellmate/ssh/server.py index cff90ca..0997180 100644 --- a/src/shellmate/ssh/server.py +++ b/src/shellmate/ssh/server.py @@ -65,36 +65,7 @@ async def handle_client(process: asyncssh.SSHServerProcess) -> None: mode = "play" try: - from shellmate.tui.app import ShellMateApp - - # Set environment for Textual - os.environ["TERM"] = term_type - os.environ["COLORTERM"] = "truecolor" - - app = ShellMateApp(username=username, mode=mode) - - # Run the app with the SSH process I/O - # Use headless driver with the process stdin/stdout - from textual.drivers.headless_driver import HeadlessDriver - from io import StringIO - - # Create a wrapper that bridges asyncssh to textual - class SSHDriver(HeadlessDriver): - def __init__(self, app, process, size): - super().__init__(app, size=size) - self._process = process - - def write(self, data: str) -> None: - try: - self._process.stdout.write(data) - except Exception: - pass - - driver = SSHDriver(app, process, (width, height)) - await app._run_async(driver=driver) - - except ImportError: - # Fallback to simple Rich-based menu + # Use simple Rich-based menu (more reliable over SSH) await run_simple_menu(process, username, mode, width, height) except Exception as e: logger.exception(f"Error in ShellMate session: {e}")