Improved regex for auto-execution of chained commands (#158)

* Improved regex for auto-execution of chained commands
This commit is contained in:
John Stearns
2024-12-17 15:15:28 -08:00
committed by GitHub
parent a982df7d1f
commit 1e83d1a835
3 changed files with 139 additions and 9 deletions

View File

@@ -523,7 +523,7 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
}
// Split command by chaining operators
const commands = command.split(/&&|\|\||;|\||\$\(|`/).map(cmd => cmd.trim())
const commands = command.split(/&&|\|\||;|(?<!"[^"]*)\|(?![^"]*")|\$\(|`/).map(cmd => cmd.trim())
// Check if all individual commands are allowed
return commands.every((cmd) => {