-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Always enable bracketed paste #16179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Summary of ChangesHello @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
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this 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)
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)
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);
});|
Size Change: -1.33 kB (-0.01%) Total Size: 22.3 MB
ℹ️ View Unchanged
|
jacob314
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
/patch stable |
|
✅ Patch workflow(s) dispatched successfully! 📋 Details:
🔗 Track Progress: |
# Conflicts: # packages/cli/src/ui/contexts/KeypressContext.tsx
|
🚀 Patch PR Created! 📋 Patch Details:
📝 Next Steps:
🔗 Track Progress: |
|
🚀 Patch Release Started! 📋 Release Details:
⏳ Status: The patch release is now running. You'll receive another update when it completes. 🔗 Track Progress: |
|
❌ Patch Release Failed! 📋 Details:
🔍 Next Steps:
🔗 Troubleshooting: |

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