Skip to content

Fix Copilot declined-install warning newline - #14222

Merged
BagToad merged 3 commits into
trunkfrom
bagtoad/fix-copilot-newline
Aug 21, 2026
Merged

BagToad merged 3 commits into
trunkfrom
bagtoad/fix-copilot-newline

Conversation

@BagToad

@BagToad BagToad commented Aug 21, 2026

Copy link
Copy Markdown
Member

Fixes #14189

Description

When gh copilot cannot find Copilot CLI and installation is declined, its warning does not end with a newline. This leaves the next shell prompt on the same line.

Add a trailing newline to the warning and cover its exact output in the primary run-function table test.

While adding that coverage, consolidate the existing execution-failure test into the run-function table and move the telemetry sampling assertion into the constructor table. This keeps command-level behavior in the two primary table tests.

How did you test this change?

Given Copilot CLI was excluded from PATH, when I ran a locally built gh copilot in a terminal and declined installation, then the warning and following shell marker appeared on separate lines:

? GitHub Copilot CLI is not installed. Would you like to install it? No
! Copilot CLI was not installed
SHELL_PROMPT_MARKER

Key points

  • The declined-install warning now terminates its output before returning.
  • The existing execution-failure coverage is consolidated into the run-function table.
  • The existing telemetry sampling assertion is consolidated into the constructor table.

Notes for reviewers

Start with the declined-install branch, then review its output case in the run-function table. Issue #14189 contains the original terminal reproduction.

Authorship and follow-up

Who wrote this:

  • A human wrote it.
  • An agent wrote it under close human direction.
  • An agent wrote it independently, and no human has guided the implementation beyond the initial prompt.

Who answers review comments:

  • @BagToad will read and reply directly.
  • An agent will draft replies and @username will read them before they are posted.
  • Nobody has explicitly committed to replying.

BagToad and others added 3 commits August 20, 2026 17:01
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 21, 2026 17:56
@BagToad
BagToad requested a review from a team as a code owner August 21, 2026 17:56
@BagToad
BagToad requested a review from babakks August 21, 2026 17:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes terminal formatting when users decline Copilot CLI installation.

Changes:

  • Adds the missing warning newline.
  • Consolidates run behavior and telemetry coverage into table-driven tests.
Show a summary per file
File Description
pkg/cmd/copilot/copilot.go Terminates the declined-install warning with a newline.
pkg/cmd/copilot/copilot_test.go Verifies exact warning output and consolidates existing tests.

Review details

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@BagToad
BagToad merged commit 5d3c481 into trunk Aug 21, 2026
19 checks passed
@BagToad
BagToad deleted the bagtoad/fix-copilot-newline branch August 21, 2026 19:44
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.

gh copilot: missing trailing newline after "Copilot CLI was not installed" message

3 participants