the inbuilt terminal kinda works now, .gitignore files also have syntax highlighting now
This commit is contained in:
8
main.py
8
main.py
@@ -51,9 +51,17 @@ class Berry(App):
|
||||
|
||||
yield Footer()
|
||||
|
||||
def on_input_submitted(self, event: Input.Submitted):
|
||||
if event.input.id != "console-input":
|
||||
return
|
||||
|
||||
self.run_command(event.input.value)
|
||||
event.input.clear()
|
||||
|
||||
def run_command(self, command: str):
|
||||
console = self.query_one("#console")
|
||||
|
||||
console.write(f"> {command}")
|
||||
result = subprocess.check_output(command, shell=True, text=True)
|
||||
console.write(result)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user