ctaylo21 / termy-the-terminal

Web-based terminal powered by React
MIT License
45 stars 2 forks source link

Unknown command handler #44

Closed nathan-fiscaletti closed 8 months ago

nathan-fiscaletti commented 1 year ago

Is there a way to add a handler for when the user enters a command that is not known? I want to implement a SQL terminal but I don't want to have to implement a custom command handler for every SQL keyword. I'd rather just accept any generic input and forward it to a SQL client, and then have the output displayed in the terminal.

ctaylo21 commented 1 year ago

Hi there - it's possible to add the functionality. You could either extend the customCommands functionality to have a method for unknown commands or add a separate handler that allows users to override the method called when an unknown command is parsed.

I haven't touched this project in a long time, so I suggest forking it and trying out that functionality yourself. Good luck!