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
|
# PyPI configuration file
|
||||||
.pypirc
|
.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 {
|
#find-window {
|
||||||
width: 45;
|
width: 45;
|
||||||
height: 11;
|
height: 11;
|
||||||
|
|||||||
9
main.py
9
main.py
@@ -7,6 +7,7 @@ from textual import on
|
|||||||
from assets.theme_mappings import theme_mappings
|
from assets.theme_mappings import theme_mappings
|
||||||
|
|
||||||
from textual_fspicker import FileOpen, FileSave
|
from textual_fspicker import FileOpen, FileSave
|
||||||
|
from textual_terminal import Terminal
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import os
|
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)
|
yield TextArea.code_editor(placeholder="This file is empty.", language="python", theme="css", id="code-editor", disabled=True)
|
||||||
|
|
||||||
|
if os.name == "nt":
|
||||||
with Vertical(id="console-container"):
|
with Vertical(id="console-container"):
|
||||||
yield RichLog(id="console")
|
yield RichLog(id="console")
|
||||||
yield Input(placeholder="> ", id="console-input")
|
yield Input(placeholder="> ", id="console-input")
|
||||||
|
else:
|
||||||
|
yield Terminal(command="bash", id="terminal")
|
||||||
|
|
||||||
yield Footer()
|
yield Footer()
|
||||||
|
|
||||||
@@ -270,8 +274,11 @@ class Berry(App):
|
|||||||
self.unsaved_files = {} # list of paths
|
self.unsaved_files = {} # list of paths
|
||||||
self.switching = False
|
self.switching = False
|
||||||
self.file_clicked = 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__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Reference in New Issue
Block a user