Skip to content

feat: Add terminal shell selection to settings#603

Open
jutaz wants to merge 2 commits into
hotovo:mainfrom
jutaz:aider-desk/task/152077c6-f93b-4675-88f3-bd757f73c561
Open

feat: Add terminal shell selection to settings#603
jutaz wants to merge 2 commits into
hotovo:mainfrom
jutaz:aider-desk/task/152077c6-f93b-4675-88f3-bd757f73c561

Conversation

@jutaz
Copy link
Copy Markdown
Contributor

@jutaz jutaz commented Jan 9, 2026

Add the ability to select an available shell for the integrated terminal. This includes:

  • A new getAvailableShells IPC event to retrieve system shells.
  • A new terminal section in SettingsData and default settings.
  • Updates to localization files for the new terminal settings.
  • A new TerminalSettings component for the UI.
  • Integration into the main Settings page.
  • Updates to the TerminalManager to use the selected shell.

Add the ability to select an available shell for the integrated terminal. This includes:

- A new `getAvailableShells` IPC event to retrieve system shells.
- A new `terminal` section in `SettingsData` and default settings.
- Updates to localization files for the new terminal settings.
- A new `TerminalSettings` component for the UI.
- Integration into the main `Settings` page.
- Updates to the `TerminalManager` to use the selected shell.
@github-actions github-actions Bot requested a review from wladimiiir January 9, 2026 09:35
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @jutaz, 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 a significant user experience improvement by allowing users to customize their integrated terminal's shell. It establishes the necessary backend infrastructure to detect and manage available shells, integrates these options into the application's settings, and updates the terminal's launch logic to respect user preferences. This feature provides greater flexibility and control over the development environment within the application.

Highlights

  • Terminal Shell Selection: Introduced the ability for users to select their preferred shell for the integrated terminal directly within the application settings, enhancing user customization.
  • New IPC Event and API Endpoint: Added a new getAvailableShells IPC event and a corresponding REST API endpoint (/settings/available-shells) to retrieve a list of system-detected shells.
  • Settings Structure and UI Updates: Integrated a new terminal section into the application's SettingsData and default settings, along with a dedicated TerminalSettings React component for the user interface. This component allows users to choose from detected shells or specify a custom path.
  • Terminal Manager Integration: The TerminalManager has been updated to utilize the shell path specified in the user's settings, ensuring that the integrated terminal launches with the chosen shell.
  • Localization and Data Migration: Updated localization files (en.json, zh.json) to support the new terminal settings. A new settings migration (v17-to-v18) was added to ensure existing users' settings are updated to include the new terminal configuration.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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.

Copy link
Copy Markdown

@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 introduces a new feature allowing users to configure their preferred terminal shell within the application settings. The changes involve adding a ShellInfo type and a terminal setting to store the user's chosen shell path. A new API endpoint and IPC handler (getAvailableShells) were implemented to detect and provide a list of available shells on the system (Windows and Unix-like). The TerminalManager was updated to use the stored shell setting, and a new settings migration (v17-to-v18) was added to initialize the terminal settings. On the frontend, a new TerminalSettings component was created, integrated into the main Settings page, to display a dropdown of detected shells and a custom input field for the shell path. Review comments suggest removing the unused args property from ShellInfo and the associated getShellArgs method to reduce complexity, logging errors when reading /etc/shells instead of silently swallowing them, and improving the UI for shell selection to avoid confusion caused by separate dropdown and text input fields modifying the same setting.

Comment thread src/common/types.ts Outdated
export interface ShellInfo {
path: string;
name: string;
args?: string[];
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The args property is populated in getAvailableShells but it's not used by the frontend or the TerminalManager. The TerminalManager has its own logic to determine shell arguments. To reduce complexity and remove dead code, this property should be removed. This would also allow for the removal of the getShellArgs method in src/main/utils/shell.ts.

Comment thread src/main/utils/shell.ts Outdated
Comment on lines +267 to +269
} catch {
// Ignore
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Swallowing errors without logging can hide potential issues and make debugging harder. For instance, if reading /etc/shells fails due to permissions, it would be helpful to see this in the logs. Please consider logging the error.

Suggested change
} catch {
// Ignore
}
} catch (error) {
logger.warn('Failed to read /etc/shells, continuing without it.', { error: error instanceof Error ? error.message : String(error) });
}

Comment thread src/renderer/src/components/settings/TerminalSettings.tsx Outdated
Adds a more user-friendly interface for selecting the terminal shell, including auto-detect, preset list, and custom
path options.
Copy link
Copy Markdown
Contributor

@wladimiiir wladimiiir left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution.

I found some issues during the testing. Could you please address them? Thank you.

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.

Seems like there has been unwanted changes in the file.

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.

Also in here, lots of the unnecessary changes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yep, my bad. Will fix.

Comment thread src/main/utils/shell.ts

// Also check /etc/shells
try {
if (fs.existsSync('/etc/shells')) {
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.

This does not seem like a good approach. It returns bunch of commands that are not really shells in my system.

Image

name="shell-mode"
value="custom"
checked={mode === 'custom'}
onChange={() => handleModeChange('custom')}
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.

Does not seem clicking on custom mode is working.

Image

Comment thread src/main/utils/shell.ts
const envShell = process.env.SHELL;
if (envShell && fs.existsSync(envShell)) {
const name = path.basename(envShell);
return { path: envShell, name, args: this.getShellArgs(name) };
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.

I don't think removing this is a good idea. Is this fixing some issue?

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.

2 participants