Skip to content

Fix injection of multiline shell commands#11

Merged
insign merged 1 commit intomainfrom
fix-multiline-command-injection-17210042863177141457
Apr 3, 2026
Merged

Fix injection of multiline shell commands#11
insign merged 1 commit intomainfrom
fix-multiline-command-injection-17210042863177141457

Conversation

@insign
Copy link
Copy Markdown
Contributor

@insign insign commented Apr 2, 2026

O que este PR faz: Corrige um bug crítico que corrompia comandos de múltiplas linhas durante a injeção no terminal. O código remove uma substituição incorreta (\n por &&) e melhora a detecção de quebras de linha (\), permitindo que a CLI junte esses comandos com espaços corretamente.

Por que é útil: Comandos com continuações de linha (\) gerados por modelos de IA (ex: comandos Docker ou comandos longos) falhavam sintaticamente ao serem executados no shell do usuário. Essa correção garante a execução confiável (Reliability & Bug Fix) de comandos complexos gerados em modo terminal, aumentando muito a utilidade e segurança da ferramenta.


PR created automatically by Jules for task 17210042863177141457 started by @insign

Removes the blind replacement of newlines with ` && ` in `inject_command` and `inject_raw_only`, which corrupted commands containing line continuations (`\`) or heredocs. Enhances `flatten_command_if_safe` to properly parse line continuations, replacing them with spaces while safely joining distinct commands with ` && `. This ensures that multi-line AI responses execute correctly in the terminal.

Co-authored-by: insign <1113045+insign@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@insign insign merged commit 776f2df into main Apr 3, 2026
9 checks passed
@insign insign deleted the fix-multiline-command-injection-17210042863177141457 branch April 3, 2026 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant