Fix web GUI: set env vars in process instead of command string
textual-serve shows the command string as the app title. Set PYTHONPATH and GNIZA_DIR as real env vars so the spawned subprocess inherits them. Add title="gniza" for clean display. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -15,9 +15,9 @@ def main():
|
||||
for i, arg in enumerate(sys.argv):
|
||||
if arg == "--port" and i + 1 < len(sys.argv):
|
||||
port = int(sys.argv[i + 1])
|
||||
env_path = f"{_PROJECT_ROOT}:{os.environ.get('PYTHONPATH', '')}"
|
||||
cmd = f"PYTHONPATH={env_path} GNIZA_DIR={_PROJECT_ROOT} python3 -m tui"
|
||||
server = Server(cmd, host="0.0.0.0", port=port)
|
||||
os.environ["PYTHONPATH"] = f"{_PROJECT_ROOT}:{os.environ.get('PYTHONPATH', '')}"
|
||||
os.environ["GNIZA_DIR"] = _PROJECT_ROOT
|
||||
server = Server("python3 -m tui", host="0.0.0.0", port=port, title="gniza")
|
||||
server.serve()
|
||||
else:
|
||||
app = GnizaApp()
|
||||
|
||||
Reference in New Issue
Block a user