feat: WezTerm-Unterstützung in toolbox (open_new_tab)
This commit is contained in:
parent
0860072166
commit
0443c61b68
1 changed files with 7 additions and 0 deletions
|
|
@ -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('"', '\\"')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue