Skip to content

Commit 030aa35

Browse files
committed
Revert "Merge pull request #15 from ElcanoTek/codex/set-ghostty-as-default-terminal-if-installed"
This reverts commit d5b4510, reversing changes made to 071c754.
1 parent d5b4510 commit 030aa35

File tree

1 file changed

+0
-44
lines changed

1 file changed

+0
-44
lines changed

victoria.py

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import os
1717
import re
1818
import shutil
19-
import shlex
2019
import subprocess
2120
import sys
2221
import tempfile
@@ -59,47 +58,6 @@ def ensure_default_files():
5958
"SNOWFLAKE_ROLE",
6059
]
6160

62-
63-
def relaunch_in_terminal() -> bool:
64-
"""Relaunch this script in a terminal window.
65-
66-
Prefers Ghostty when available on macOS or Linux. Falls back to the
67-
default system terminal when Ghostty isn't installed. Returns True if a
68-
new terminal was spawned and the caller should exit."""
69-
70-
if os.environ.get("VICTORIA_IN_TERMINAL"):
71-
return False
72-
73-
cmd: List[str] = [sys.executable, str(Path(__file__).resolve())] + sys.argv[1:]
74-
env = os.environ.copy()
75-
env["VICTORIA_IN_TERMINAL"] = "1"
76-
77-
ghostty = shutil.which("ghostty")
78-
if ghostty and sys.platform != "win32":
79-
try:
80-
subprocess.Popen([ghostty, "-e", *cmd], env=env)
81-
return True
82-
except Exception:
83-
pass
84-
85-
if sys.platform == "darwin":
86-
try:
87-
osa_cmd = f'tell application "Terminal" to do script "{shlex.join(cmd)}"'
88-
subprocess.Popen(["osascript", "-e", osa_cmd], env=env)
89-
return True
90-
except Exception:
91-
pass
92-
elif sys.platform.startswith("linux"):
93-
term = shutil.which("x-terminal-emulator")
94-
if term:
95-
try:
96-
subprocess.Popen([term, "-e", *cmd], env=env)
97-
return True
98-
except Exception:
99-
pass
100-
101-
return False
102-
10361
# ------------------ Terminal Capability Detection ------------------
10462
def _enable_windows_ansi():
10563
"""Best-effort enable ANSI on Windows without external deps."""
@@ -819,8 +777,6 @@ def main():
819777
launch_tool()
820778

821779
if __name__ == "__main__":
822-
if relaunch_in_terminal():
823-
sys.exit(0)
824780
try:
825781
main()
826782
except KeyboardInterrupt:

0 commit comments

Comments
 (0)