Skip to content

Conversation

@scidomino
Copy link
Collaborator

@scidomino scidomino commented Jan 8, 2026

Summary

Always enable bracket paste since it'll either be supported, or ignored.

Details

We were previously using DECRQM to detected bracketed paste support. Unfortunately it's not supported by important terminals like hterm (and thus secure shell, and ChromeOS) even though they do support bracketed paste.

Also: Removes fast-return support since this is a better fix for that issue and it could have caused problems for users on slow connections.

Related Issues

Fixes #16125

How to Validate

Running through secure shell, copy/paste the contents of https://en.wikipedia.org/wiki/Copper into the input and verify that it's fast and speedy.

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @scidomino, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request simplifies and enhances the reliability of bracketed paste functionality by removing the conditional detection mechanism. Instead of querying terminal capabilities, bracketed paste is now always enabled, as unsupported terminals will gracefully ignore the activation sequence. This change resolves compatibility issues with certain terminal emulators that support bracketed paste but failed the previous detection method, ensuring a more consistent user experience for copy-pasting large blocks of text.

Highlights

  • Bracketed Paste Activation: Bracketed paste mode is now unconditionally enabled, removing the previous reliance on DECRQM detection.
  • Improved Compatibility: This change addresses issues with terminals like hterm (used in secure shell and ChromeOS) that support bracketed paste but do not respond to DECRQM queries.
  • Simplified Logic: The code for detecting bracketed paste support, including its regex and related state variables, has been removed, streamlining the TerminalCapabilityManager.
  • Test Removal: Corresponding unit tests for bracketed paste detection have been removed as the detection mechanism is no longer in use.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@scidomino scidomino marked this pull request as ready for review January 8, 2026 18:56
@scidomino scidomino requested a review from a team as a code owner January 8, 2026 18:56
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request simplifies terminal capability detection by always enabling bracketed paste mode, which is a good improvement. The code changes are mostly correct, but I've found a couple of areas for improvement. First, an unnecessary terminal query for bracketed paste detection is still being sent and should be removed. Second, while the tests for the old detection logic were correctly removed, a new test should be added to ensure the new behavior of always enabling bracketed paste is covered.

I am having trouble creating individual review comments. Click here to see my feedback.

packages/cli/src/ui/utils/terminalCapabilityManager.ts (46-49)

high

While you've correctly removed the logic for parsing the bracketed paste support response, the query to detect it is still being sent. To complete the removal of the detection logic, you should also remove the BRACKETED_PASTE_QUERY constant and its usage in the writeSync call within detectCapabilities.

packages/cli/src/ui/utils/terminalCapabilityManager.test.ts (270-310)

high

While it's correct to remove the tests for bracketed paste detection, it would be beneficial to add a new test to verify that bracketed paste is now always enabled after detectCapabilities runs. This ensures the new behavior is covered by tests.

For example, you could add a test like this:

it('should always enable bracketed paste', async () => {
  const manager = TerminalCapabilityManager.getInstance();
  const promise = manager.detectCapabilities();

  // Complete detection with DA1 only, to simulate a terminal that doesn't
  // respond to other queries.
  stdin.emit('data', Buffer.from('\x1b[?62c'));

  await promise;
  expect(manager.isBracketedPasteEnabled()).toBe(true);
});

@github-actions
Copy link

github-actions bot commented Jan 8, 2026

Size Change: -1.33 kB (-0.01%)

Total Size: 22.3 MB

Filename Size Change
./bundle/gemini.js 22.3 MB -1.33 kB (-0.01%)
ℹ️ View Unchanged
Filename Size
./bundle/sandbox-macos-permissive-closed.sb 1.03 kB
./bundle/sandbox-macos-permissive-open.sb 890 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB
./bundle/sandbox-macos-restrictive-closed.sb 3.29 kB
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB

compressed-size-action

@gemini-cli gemini-cli bot added priority/p1 Important and should be addressed in the near term. area/core Issues related to User Interface, OS Support, Core Functionality labels Jan 8, 2026
@scidomino scidomino marked this pull request as draft January 8, 2026 19:20
Copy link
Collaborator

@jacob314 jacob314 left a comment

Choose a reason for hiding this comment

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

lgtm

@scidomino scidomino marked this pull request as ready for review January 9, 2026 15:58
@scidomino scidomino enabled auto-merge January 9, 2026 15:58
@scidomino scidomino added this pull request to the merge queue Jan 9, 2026
Merged via the queue into main with commit 88f1ec8 Jan 9, 2026
26 checks passed
@scidomino scidomino deleted the tomm_paste branch January 9, 2026 16:14
sumansaurabh pushed a commit to sumansaurabh/gemini-cli that referenced this pull request Jan 9, 2026
@scidomino
Copy link
Collaborator Author

/patch stable

@github-actions
Copy link

Patch workflow(s) dispatched successfully!

📋 Details:

  • Channels: stable
  • Commit: 88f1ec8d0ae40ee81eba7a997abe7a324f101aa7
  • Workflows Created: 1

🔗 Track Progress:

github-actions bot pushed a commit that referenced this pull request Jan 15, 2026
# Conflicts:
#	packages/cli/src/ui/contexts/KeypressContext.tsx
@github-actions
Copy link

🚀 Patch PR Created!

📋 Patch Details:

📝 Next Steps:

  1. ⚠️ Resolve conflicts in the hotfix PR first: #16783
  2. Test your changes after resolving conflicts
  3. Once merged, the patch release will automatically trigger
  4. You'll receive updates here when the release completes

🔗 Track Progress:

scidomino added a commit that referenced this pull request Jan 15, 2026
scidomino added a commit that referenced this pull request Jan 15, 2026
@github-actions
Copy link

🚀 Patch Release Started!

📋 Release Details:

  • Environment: prod
  • Channel: stable → publishing to npm tag latest
  • Version: v0.24.0
  • Hotfix PR: Merged ✅
  • Release Branch: release/v0.24.0-pr-16179

⏳ Status: The patch release is now running. You'll receive another update when it completes.

🔗 Track Progress:

@github-actions
Copy link

Patch Release Failed!

📋 Details:

  • Version: 0.24.1
  • Channel: stable
  • Error: The patch release workflow encountered an error

🔍 Next Steps:

  1. Check the workflow logs for detailed error information
  2. The maintainers have been notified via automatic issue creation
  3. You may need to retry the patch once the issue is resolved

🔗 Troubleshooting:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Issues related to User Interface, OS Support, Core Functionality priority/p1 Important and should be addressed in the near term.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Paste is slow over ssh (and sometimes duplicates content)

2 participants