Exafunction / codeium.nvim

A native neovim extension for Codeium
MIT License
644 stars 50 forks source link

Handle MINGW32_NT-10.0 sysname of MSYS2 on Windows #145

Closed Drunk-Dream closed 4 months ago

Drunk-Dream commented 4 months ago

This PR fixes an issue where the get_system_info() function fails to recognize the "MINGW32_NT-10.0" sysname returned when running on Windows under MSYS2.

Changes

Reason for Change

Currently, get_system_info() only checks for "Windows_NT" sysname to identify Windows. When running on MSYS2, the sysname is "MINGW32_NT-10.0" which causes get_system_info() to fail with an "Unknown sysname" warning.

Checking for and handling MINGW32_NT-10.0 allows get_system_info() to work properly when running on Windows under MSYS2.

consoleaf commented 4 months ago

What will happen if it's MSYS2 on Windows 11? Is it still going to have 10.0 in the sysname? Maybe it's better to check for a substring MINGW32_NT?

Drunk-Dream commented 4 months ago

What will happen if it's MSYS2 on Windows 11? Is it still going to have 10.0 in the sysname? Maybe it's better to check for a substring MINGW32_NT?

Yes, MSYS2 on Windows 11 will still have 10.0 in the sysname. I think it would be a good idea to check for the MINGW32_NT substring.

fortenforge commented 4 months ago

Please check the substring

Drunk-Dream commented 4 months ago

Please check the substring

Ok, in the new commit I am using string.find() to check the substring MINGW32_NT.