diff --git a/assets/theme_mappings.py b/assets/theme_mappings.py index 5b46920..f273f39 100644 --- a/assets/theme_mappings.py +++ b/assets/theme_mappings.py @@ -12,5 +12,6 @@ theme_mappings = { "go": "go", "sh": "bash", "yaml": "yaml", - "md": "markdown" + "md": "markdown", + "gitignore": "markdown" } \ No newline at end of file diff --git a/main.py b/main.py index 0012537..edafcdc 100644 --- a/main.py +++ b/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)