Conversation
Use case-insensitive substring matching instead of exact map lookups to handle process names like "tmux: server" that weren't being matched before. This makes the terminal resolver more robust across different systems and process naming conventions.
Summary of ChangesHello @AnnatarHe, 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 significantly enhances the robustness of the terminal resolver by transitioning from exact, case-sensitive process name lookups to a more flexible case-insensitive substring matching approach. This change ensures that the system can accurately identify terminal emulators, multiplexers, and remote connections even when process names include additional descriptors or vary in casing, thereby improving compatibility across diverse operating environments. 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
|
Codecov Report❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review
This pull request improves the terminal resolver by switching from exact, case-sensitive process name matching to a more robust case-insensitive substring matching. This is a good change that should handle more variations in process names across different systems.
My review includes a few points:
- I've identified a potential regression where the
stterminal emulator was removed from the list of known terminals. I've suggested adding it back. - I've also suggested a minor refactoring to simplify the conditional logic in
ResolveTerminal, making it more concise and readable.
Overall, the approach is solid, and with these small adjustments, it will be even better.
| "urxvt", | ||
| "rxvt", | ||
| "terminator", | ||
| "tilix", |
There was a problem hiding this comment.
| if multiplexer == "" { | ||
| if matched := matchKnownName(processName, knownMultiplexers); matched != "" { | ||
| multiplexer = matched | ||
| } | ||
| } |
There was a problem hiding this comment.
This conditional assignment can be made more concise. Since matchKnownName returns an empty string when there's no match, you can directly assign its return value inside the if block. This avoids the nested if and the temporary matched variable.
if multiplexer == "" {
multiplexer = matchKnownName(processName, knownMultiplexers)
}| if terminal == "" { | ||
| if matched := matchKnownName(processName, knownTerminals); matched != "" { | ||
| terminal = matched | ||
| } | ||
| } |
| if terminal == "" { | ||
| if matched := matchKnownName(processName, knownRemote); matched != "" { | ||
| terminal = matched | ||
| } | ||
| } |
Use case-insensitive substring matching instead of exact map lookups to handle process names like "tmux: server" that weren't being matched before. This makes the terminal resolver more robust across different systems and process naming conventions.