inbuilt terminal emulator is better on linux/macos now

i need to test this on mac actually
This commit is contained in:
SpookyDervish
2025-10-26 19:39:14 +11:00
parent cc80a1ddf8
commit 1f81caf29f
3 changed files with 21 additions and 5 deletions

3
.gitignore vendored
View File

@@ -174,3 +174,6 @@ cython_debug/
# PyPI configuration file
.pypirc
# virtual environment i use for testing
berry-venv

View File

@@ -53,6 +53,12 @@ ContentSwitcher Vertical {
}
}
#terminal {
height: 35%;
min-height: 12;
margin: 1;
}
#find-window {
width: 45;
height: 11;

17
main.py
View File

@@ -7,6 +7,7 @@ from textual import on
from assets.theme_mappings import theme_mappings
from textual_fspicker import FileOpen, FileSave
from textual_terminal import Terminal
import subprocess
import os
@@ -46,9 +47,12 @@ class Berry(App):
)
yield TextArea.code_editor(placeholder="This file is empty.", language="python", theme="css", id="code-editor", disabled=True)
with Vertical(id="console-container"):
yield RichLog(id="console")
yield Input(placeholder="> ", id="console-input")
if os.name == "nt":
with Vertical(id="console-container"):
yield RichLog(id="console")
yield Input(placeholder="> ", id="console-input")
else:
yield Terminal(command="bash", id="terminal")
yield Footer()
@@ -270,8 +274,11 @@ class Berry(App):
self.unsaved_files = {} # list of paths
self.switching = False
self.file_clicked = False
self.query_one("#console").write("Run a command below.")
if os.name == "nt":
self.query_one("#console").write("Run a command below.")
else:
self.query_one("#terminal").start()
if __name__ == "__main__":