Skip to content

Add no-heredoc instructions to prevent terminal file corruption#662

Open
garrettsiegel wants to merge 2 commits intogithub:mainfrom
garrettsiegel:add-no-heredoc-instructions
Open

Add no-heredoc instructions to prevent terminal file corruption#662
garrettsiegel wants to merge 2 commits intogithub:mainfrom
garrettsiegel:add-no-heredoc-instructions

Conversation

@garrettsiegel
Copy link
Contributor

Adds instructions to prevent file corruption caused by terminal heredoc operations in VS Code Copilot.

Problem

Heredoc syntax (cat << EOF) in VS Code's integrated terminal causes file corruption due to:

  • Tab completion interference
  • Quote/backtick escaping failures
  • Exit code 130 interruptions

Solution

This instruction file tells Copilot to always use file editing tools instead of terminal redirections for any file creation or modification.

Applies to all files (**) since the issue affects any agent writing files via terminal.

Copilot AI review requested due to automatic review settings February 3, 2026 17:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new instruction file to prevent file corruption caused by heredoc operations in VS Code's integrated terminal when using Copilot.

Changes:

  • Adds no-heredoc.instructions.md instruction file that enforces the use of file editing tools instead of terminal heredoc operations (cat << EOF, etc.)

Comment on lines +1 to +4
---
description: 'Prevents terminal heredoc file corruption in VS Code Copilot by enforcing use of file editing tools instead of shell redirections'
applyTo: '**'
---
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the repository's coding guidelines for instruction files, the new file should be added to docs/README.instructions.md. The entry should be added alphabetically between "Next.js Best Practices for LLMs (2026)" and "Object Calisthenics Rules" (approximately line 122-123 in the README). The entry should follow the same format as other entries in the table, including a title, file path, install badges, and the description from the front matter.

Copilot generated this review using guidance from repository custom instructions.
Comment on lines +1 to +4
---
description: 'Prevents terminal heredoc file corruption in VS Code Copilot by enforcing use of file editing tools instead of shell redirections'
applyTo: '**'
---
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a name field here so the instructions are more discoverable rather than relying on the first H1 of the markdown.

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.

2 participants