File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,11 +31,21 @@ EVENT_SCHEMA = "sourceos.terminal.event.v0"
3131RECEIPT_SCHEMA = "sourceos.terminal.receipt.v0"
3232
3333
34+ def env (name : str , fallback : str = "" ) -> str :
35+ value = os .environ .get (name )
36+ if value is None or value == "" :
37+ return fallback
38+ return value
39+
40+
3441def invoked_name () -> str :
3542 return Path (sys .argv [0 ]).name or "turtle-term"
3643
3744
3845def product_name () -> str :
46+ explicit = env ("SOURCEOS_TERMINAL_CLI" )
47+ if explicit in {"turtle-term" , "sourceos-term" }:
48+ return explicit
3949 name = invoked_name ()
4050 if name == "sourceos-term" :
4151 return "sourceos-term"
@@ -56,13 +66,6 @@ def new_id(prefix: str) -> str:
5666 return f"{ prefix } _{ uuid .uuid4 ().hex } "
5767
5868
59- def env (name : str , fallback : str = "" ) -> str :
60- value = os .environ .get (name )
61- if value is None or value == "" :
62- return fallback
63- return value
64-
65-
6669def xdg_runtime_dir () -> Path :
6770 return Path (env ("XDG_RUNTIME_DIR" , f"/tmp/sourceos-runtime-{ os .getuid ()} " ))
6871
You can’t perform that action at this time.
0 commit comments