the inbuilt terminal kinda works now, .gitignore files also have syntax highlighting now

This commit is contained in:
SpookyDervish
2025-10-26 13:23:47 +11:00
parent 6af08dece4
commit ff6e6cc788
2 changed files with 10 additions and 1 deletions

View File

@@ -12,5 +12,6 @@ theme_mappings = {
"go": "go", "go": "go",
"sh": "bash", "sh": "bash",
"yaml": "yaml", "yaml": "yaml",
"md": "markdown" "md": "markdown",
"gitignore": "markdown"
} }

View File

@@ -51,9 +51,17 @@ class Berry(App):
yield Footer() 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): def run_command(self, command: str):
console = self.query_one("#console") console = self.query_one("#console")
console.write(f"> {command}")
result = subprocess.check_output(command, shell=True, text=True) result = subprocess.check_output(command, shell=True, text=True)
console.write(result) console.write(result)