mirror of
https://github.com/Textualize/textual-web.git
synced 2025-10-17 02:36:40 +03:00
no terminal on windows
This commit is contained in:
13
examples/env.py
Normal file
13
examples/env.py
Normal 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()
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user