mirror of
https://github.com/saphid/frame-control.git
synced 2026-10-06 05:02:50 +02:00
Fix review findings and Windows setup issues found in testing
- Run the server with -X utf8: the bundled Windows Python ignores PYTHON* variables. - Quote every argument in Windows terminal commands, so cmd metacharacters are literal. - frame_connect: accept HOST:PORT, validate input, retry the config swap while Windows' ssh.exe holds ~/.ssh/config locked, and don't apply 0o700 on Windows. - Never use rsync on Windows; unbounded stream queue; validate FRAME_ALIAS; more Linux terminals; bundle the window icon; docs and wording fixes. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
fc2fa65f0d
commit
e210407f31
11 files changed
+90
-39
No files matched your search
+7
-5
@@ -146,16 +146,18 @@ def open_terminal(argv, title="Frame Control"):
|
||||
# `start` gives the command its own console window; cmd /k keeps it open.
|
||||
# One hand-built command line: quoting it twice through list2cmdline would
|
||||
# produce backslash-escaped quotes, which cmd doesn't understand.
|
||||
inner = subprocess.list2cmdline(argv)
|
||||
# Every argument is quoted, so cmd treats & | < > ^ in them literally.
|
||||
inner = " ".join('"%s"' % a.replace('"', '\\"') for a in argv)
|
||||
subprocess.Popen(f'cmd.exe /c start "{title}" cmd.exe /k "{inner}"', **DETACHED)
|
||||
return "a terminal window"
|
||||
script = f'{shlex.join(argv)}; echo; read -r -p "Press Enter to close. " _'
|
||||
for name, flag in (("x-terminal-emulator", "-e"), ("gnome-terminal", "--"), ("konsole", "-e"),
|
||||
("xfce4-terminal", "-x"), ("kitty", None), ("alacritty", "-e"),
|
||||
("foot", None), ("xterm", "-e")):
|
||||
for name, flags in (("x-terminal-emulator", ["-e"]), ("gnome-terminal", ["--"]), ("ptyxis", ["--"]),
|
||||
("kgx", ["--"]), ("konsole", ["-e"]), ("xfce4-terminal", ["-x"]),
|
||||
("tilix", ["-e"]), ("lxterminal", ["-e"]), ("kitty", []), ("alacritty", ["-e"]),
|
||||
("wezterm", ["start", "--"]), ("foot", []), ("xterm", ["-e"])):
|
||||
exe = which(name)
|
||||
if exe:
|
||||
_spawn([exe, *([flag] if flag else []), "bash", "-c", script])
|
||||
_spawn([exe, *flags, "bash", "-c", script])
|
||||
return name
|
||||
raise HostError("No terminal program found (tried gnome-terminal, konsole, xterm and others)")
|
||||
|
||||
|
||||
Reference in new issue
Block a user