inbuilt terminal emulator is better on linux/macos now
i need to test this on mac actually
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -174,3 +174,6 @@ cython_debug/
|
||||
# PyPI configuration file
|
||||
.pypirc
|
||||
|
||||
|
||||
# virtual environment i use for testing
|
||||
berry-venv
|
||||
@@ -53,6 +53,12 @@ ContentSwitcher Vertical {
|
||||
}
|
||||
}
|
||||
|
||||
#terminal {
|
||||
height: 35%;
|
||||
min-height: 12;
|
||||
margin: 1;
|
||||
}
|
||||
|
||||
#find-window {
|
||||
width: 45;
|
||||
height: 11;
|
||||
|
||||
15
main.py
15
main.py
@@ -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__":
|
||||
|
||||
Reference in New Issue
Block a user