Skip to content

Code snippets starting with // cause Unknown command: // in GitHub CLI #1330

@federicobrancasi

Description

@federicobrancasi

Describe the bug

Code snippets starting with // cause Unknown command: // in GitHub CLI

Description

When pasting code into the GitHub CLI, any snippet that begins with // triggers an error:

✗ Unknown command: //

Example:

// this prints hello
print("hello")

The CLI interprets // as a command instead of treating it as literal text. This makes it difficult to paste code examples that use // comments unless the user manually wraps everything in triple‑backtick fences.

Expected behavior

// inside pasted text should be treated as literal content when entering issue or PR text.

Actual behavior

The CLI attempts to execute // as a command and returns:

✗ Unknown command: //

Steps to reproduce

  1. Paste a snippet starting with //.
  2. Observe the error.

Affected version

GitHub Copilot CLI 0.0.403.

Steps to reproduce the behavior

Steps to reproduce

  1. Paste a snippet starting with //.
  2. Observe the error.

Expected behavior

Expected behavior

// inside pasted text should be treated as literal content when entering issue or PR text.

Actual behavior

The CLI attempts to execute // as a command and returns:

✗ Unknown command: //

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions