feat: WezTerm-Unterstützung in toolbox (open_new_tab)

This commit is contained in:
rene 2026-04-10 11:25:49 +02:00
parent 0860072166
commit 0443c61b68

View file

@ -669,6 +669,13 @@ def open_new_tab(command: str) -> None:
"""Öffnet den Befehl in einem neuen Tab im aktuellen Verzeichnis.""" """Öffnet den Befehl in einem neuen Tab im aktuellen Verzeichnis."""
full_cmd = f"cd {shlex.quote(CURRENT_DIR)} && {command}" full_cmd = f"cd {shlex.quote(CURRENT_DIR)} && {command}"
# WezTerm (macOS + Linux)
if shutil.which("wezterm") and os.environ.get("TERM_PROGRAM") == "WezTerm":
bash_cmd = f"{full_cmd}; exec bash"
subprocess.Popen(["wezterm", "cli", "spawn", "--cwd", CURRENT_DIR,
"--", "bash", "-c", bash_cmd])
return
if IS_MAC: if IS_MAC:
import tempfile import tempfile
escaped = full_cmd.replace("\\", "\\\\").replace('"', '\\"') escaped = full_cmd.replace("\\", "\\\\").replace('"', '\\"')