Conversation
|
Hi @jacob314, thank you so much for your contribution to Gemini CLI! We really appreciate the time and effort you've put into this. We're making some updates to our contribution process to improve how we track and review changes. Please take a moment to review our recent discussion post: Improving Our Contribution Process & Introducing New Guidelines. Key Update: Starting January 26, 2026, the Gemini CLI project will require all pull requests to be associated with an existing issue. Any pull requests not linked to an issue by that date will be automatically closed. Thank you for your understanding and for being a part of our community! |
Summary of ChangesHello @jacob314, 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 delivers significant improvements to the undo and redo functionality, making it more robust and user-friendly across different environments. It specifically addresses challenges with Option+Z key combinations in various terminal emulators, including a critical fix for Greek locale users to prevent unintended undo actions when typing the Omega character. Additionally, it streamlines the setup process for VSCode users by automatically configuring essential undo/redo keybindings and refines iTerm2 detection for more accurate user feedback. Highlights
Changelog
Activity
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.
Code Review
This pull request introduces fixes for the undo/redo functionality, particularly for VSCode and iTerm2 users, and adds better support for non-English keyboard layouts like Greek. The changes include updating keybinding documentation, adding specific key handling for Option+Z on macOS, and automatically configuring VSCode keybindings to ensure undo/redo works correctly. The addition of new tests, including for the Greek locale, is a great improvement.
My review focuses on two areas for improvement: reducing code duplication in the VSCode setup script for better maintainability, and restoring a more robust method for detecting iTerm2 to avoid potential regressions.
| cachedIsITerm2 = | ||
| process.env['TERM_PROGRAM'] === 'iTerm.app' || | ||
| !!process.env['ITERM_SESSION_ID']; | ||
| cachedIsITerm2 = process.env['TERM_PROGRAM'] === 'iTerm.app'; |
There was a problem hiding this comment.
The check for ITERM_SESSION_ID has been removed from the isITerm2 detection logic. While TERM_PROGRAM works for local sessions, ITERM_SESSION_ID is a more robust check that also works in other scenarios, such as over SSH where TERM_PROGRAM may not be forwarded. Removing this check could be a regression, making iTerm2 detection less reliable. Unless there was a specific reason to remove it, it would be best to restore this check for more robust terminal detection.
| cachedIsITerm2 = process.env['TERM_PROGRAM'] === 'iTerm.app'; | |
| cachedIsITerm2 = | |
| process.env['TERM_PROGRAM'] === 'iTerm.app' || | |
| !!process.env['ITERM_SESSION_ID']; |
There was a problem hiding this comment.
This is intentional because otherwise if you run VSCode launching it from iterm2 we believe the vscode terminal is an iterm2 terminal which is not what we want.
|
Size Change: +896 B (0%) Total Size: 23.7 MB ℹ️ View Unchanged
|
|
I've reviewed the PR and made some optimizations and refactorings:
All tests are passing. |
|
Fyi @scidomino when you are back take a look at this to make sure there is nothing we need to fix. |
With the fix option-z works in both and cmd+z works in vscode (after running /terminal-setup)
Summary
We recently switched to option-z instead of ctrl-z for und. Unfortunately this breaks vscode and iterm.
Details
Fixed by adding iterm2 handling for alt-Z and shift+alt-Z that works as long as the language is not Greek as these are common letters in greek.
Removed check for ITERM_SESSION_ID that was making us think vscode terminals where iterm2 terminals if vscode was launched from iterm2.
Related Issues
Fixes #18148