gemini-cli icon indicating copy to clipboard operation
gemini-cli copied to clipboard

Detect default VSCode installation on macOS (non-$PATH)

Open KRRT7 opened this issue 1 year ago • 8 comments

What happened?

Image

What did you expect to happen?

VSC is installed, thus, it should be detected

Client information

$ gemini /about
│                                                                                        │
│ About Gemini CLI                                                                       │
│                                                                                        │
│ CLI Version                   0.1.3                                                    │
│ Git Commit                    382486e (local modifications)                            │
│ Model                         gemini-2.5-pro                                           │
│ Sandbox                       no sandbox                                               │
│ OS                            darwin                                                   │
│                                                                                        │
╰────────────────────────────────────────────────────────────────────────────────────────╯

Login information

No response

Anything else we need to know?

No response

KRRT7 avatar Jun 26 '25 01:06 KRRT7

Seems like users that have not installed code on the $PATH on macos will not get VS Code as an option.

I think we should also check for the default install location: /Applications/Visual Studio Code.app/Contents/Resources/app/bin/code

markmcd avatar Jun 26 '25 04:06 markmcd

See also #1698 for custom editor support.

markmcd avatar Jun 26 '25 04:06 markmcd

Rather than mess the detection how about just documenting clearly to the user that they should install code in their path. This is really easy to do in VS Code: Command Shift P to open the Command Palette then select "Shell Command: Install 'code' command in PATH"

justinhj avatar Jun 28 '25 18:06 justinhj

Rather than mess the detection how about just documenting clearly to the user that they should install code in their path. This is really easy to do in VS Code: Command Shift P to open the Command Palette then select "Shell Command: Install 'code' command in PATH"

it's not reliable, I've tried it on my machine and tried various fixes without success

KRRT7 avatar Jun 29 '25 12:06 KRRT7

Seems like users that have not installed code on the $PATH on macos will not get VS Code as an option.

I think we should also check for the default install location: /Applications/Visual Studio Code.app/Contents/Resources/app/bin/code

Hi @markmcd I created a PR #2303 for this issue. Could you please review it or assign someone so I can get some feedback? Thanks!

devpool007 avatar Jun 30 '25 15:06 devpool007

Rather than mess the detection how about just documenting clearly to the user that they should install code in their path. This is really easy to do in VS Code: Command Shift P to open the Command Palette then select "Shell Command: Install 'code' command in PATH"

Thanks, it was as simple as that – issue fixed!

saladin0x1 avatar Jul 01 '25 08:07 saladin0x1

Rather than mess the detection how about just documenting clearly to the user that they should install code in their path. This is really easy to do in VS Code: Command Shift P to open the Command Palette then select "Shell Command: Install 'code' command in PATH"

it's not reliable, I've tried it on my machine and tried various fixes without success

I know "it works on my machine" isn't helpful but maybe worth filing a bug report with the VS Code people

justinhj avatar Jul 03 '25 15:07 justinhj

Hello! As part of our effort to keep our backlog manageable and focus on the most active issues, we are tidying up older reports.

It looks like this issue hasn't been active for a while, so we are closing it for now. However, if you are still experiencing this bug on the latest stable build, please feel free to comment on this issue or create a new one with updated details.

Thank you for your contribution!

gemini-cli[bot] avatar Dec 03 '25 21:12 gemini-cli[bot]