-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix HTML escapes in terminal commands #1917
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Fixes RooCodeInc#1916 Implemented common fixes for HTML escapes that have appeared when commands are generated in the RooCode Extension and then executed in the terminal --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/RooVetGit/Roo-Code/issues/1916?shareId=XXXX-XXXX-XXXX-XXXX).
|
|
|
||
| const cwdString = cwd.toString() | ||
| const newTerminal = new Terminal(this.nextTerminalId++, terminal, cwdString) | ||
| const sanitizedCwd = TerminalProcess.sanitizeHtmlEscapes(cwdString) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling TerminalProcess.sanitizeHtmlEscapes(cwdString) here is problematic because the sanitizeHtmlEscapes method in TerminalProcess is declared as a private instance method and not static. To reuse this functionality across modules (as needed here for HTML escape sanitization), consider extracting it to a shared utility module or making it a public static method. This follows our modular design and prevents cross-module private access.
|
@KJ7LNW would you be able to give feedback on this one since it touches the terminal code? Thank you! |
If I understand correctly, this is an HTML entity escaping problem before being passed to the command, in which case it is not the responsibility of the terminal handler to process escape sequences However, if we are really getting @topperge, please
|
…oCodeInc#1917) This reverts commit b0446f7.
…ooCodeInc#1917) (RooCodeInc#1942) * Reapply "Add IS_DEV and Hot Reloading to debug. (RooCodeInc#1895)" (RooCodeInc#1917) This reverts commit 25ea46a. * Update TODO to be more explicit. Update logic for checking IS_DEV * Update TODO with even more explanation. (Now with 2x more explanation per explanation
|
I think #2120 should cover most of this, but let me know if you're seeing anything sneak through! |

Fixes #1916
Implemented common fixes for HTML escapes that have appeared when commands are generated in the RooCode Extension and then executed in the terminal
For more details, open the Copilot Workspace session.
Important
Fixes HTML escape issues in terminal commands by sanitizing inputs using
sanitizeHtmlEscapes()in multiple files.sanitizeHtmlEscapes()inexecute-command.ts,Terminal.ts, andTerminalProcess.ts.sanitizeHtmlEscapes()to handle HTML escape sequences inexecute-command.ts,Terminal.ts, andTerminalProcess.ts.getExecuteCommandDescription()inexecute-command.tsto usesanitizeHtmlEscapes()for command and cwd parameters.runCommand()inTerminal.tsandrun()inTerminalProcess.tsto sanitize commands.createTerminal()inTerminalRegistry.tsto sanitize cwd usingsanitizeHtmlEscapes().This description was created by
for f5f230a. It will automatically update as commits are pushed.