new: auto run snippet (#67)

This commit is contained in:
lollipopkit
2024-02-18 15:00:41 +08:00
parent 8bfea497a0
commit 61ddb56639
31 changed files with 221 additions and 122 deletions

View File

@@ -382,6 +382,13 @@ class _SSHPageState extends State<SSHPage> with AutomaticKeepAliveClientMixin {
if (widget.initCmd != null) {
_terminal.textInput(widget.initCmd!);
_terminal.keyInput(TerminalKey.enter);
} else {
for (final snippet in Pros.snippet.snippets) {
if (snippet.autoRunOn?.contains(widget.spi.id) == true) {
_terminal.textInput(snippet.script);
_terminal.keyInput(TerminalKey.enter);
}
}
}
await session.done;