no terminal on windows

This commit is contained in:
Will McGugan
2023-08-26 15:31:08 +01:00
parent bc0395574e
commit 58956598bf
3 changed files with 24 additions and 1 deletions

13
examples/env.py Normal file
View File

@@ -0,0 +1,13 @@
from textual.app import App, ComposeResult
from textual.widgets import Pretty
import os
class TerminalEnv(App):
def compose(self) -> ComposeResult:
yield Pretty(dict(os.environ))
if __name__ == "__main__":
TerminalEnv().run()

View File

@@ -158,7 +158,9 @@ def app(
if terminal:
ganglion_client.add_terminal(
"Terminal", os.environ.get("SHELL", "bin/sh"), identity.generate().lower()
"Terminal",
os.environ.get("SHELL", "bin/sh"),
identity.generate().lower(),
)
if not ganglion_client.app_count:

View File

@@ -293,6 +293,14 @@ class GanglionClient(Handlers):
app.model_dump(include={"name", "slug", "color", "terminal"})
for app in self.config.apps
]
if WINDOWS:
filter_apps = [app for app in apps if not app["terminal"]]
if filter_apps != apps:
log.warn(
"Sorry, textual-web does not currently support terminals on Windows"
)
apps = filter_apps
await self.send(packets.DeclareApps(apps))
async def send(self, packet: Packet) -> bool: