v1.8.7: robust sudo auto-password + debug status
- Strip ANSI escapes before sudo prompt detection - Normalize \r\n/\r line endings for reliable matching - 300ms delay before sending password (PTY settle time) - Status bar feedback: "sudo: password sent automatically" - Encode password explicitly as UTF-8 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -174,13 +174,21 @@ class TerminalTab(ctk.CTkFrame):
|
||||
if "[sudo] password for" in last_line:
|
||||
server = self.store.get_server(self._current_alias)
|
||||
if server and server.get("password"):
|
||||
pwd = server["password"]
|
||||
# Small delay — let the PTY settle before sending
|
||||
def _send_sudo_pass():
|
||||
def _send_sudo_pass(p=pwd):
|
||||
if self._session and self._session.connected:
|
||||
self._session.send(server["password"].encode() + b"\n")
|
||||
self.after(200, _send_sudo_pass)
|
||||
self._session.send(p.encode("utf-8") + b"\n")
|
||||
self._terminal.set_status(
|
||||
"sudo: password sent automatically", "#44cc44"
|
||||
)
|
||||
self.after(300, _send_sudo_pass)
|
||||
self._sudo_sent = True
|
||||
self._sudo_buffer = b""
|
||||
else:
|
||||
self._terminal.set_status(
|
||||
"sudo: no password in server config", "#ff4444"
|
||||
)
|
||||
|
||||
def _on_disconnected(self):
|
||||
"""Called from SSH read thread."""
|
||||
|
||||
BIN
releases/ServerManager-v1.8.7-win-x64.exe
Normal file
BIN
releases/ServerManager-v1.8.7-win-x64.exe
Normal file
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
"""Version info for ServerManager."""
|
||||
|
||||
__version__ = "1.8.6"
|
||||
__version__ = "1.8.7"
|
||||
__app_name__ = "ServerManager"
|
||||
__author__ = "aibot777"
|
||||
__description__ = "Desktop GUI for managing remote servers"
|
||||
|
||||
Reference in New Issue
Block a user