Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some bug on Windows #120

Merged
merged 7 commits into from
Jan 1, 2022
Merged

Fix some bug on Windows #120

merged 7 commits into from
Jan 1, 2022

Conversation

moeshin
Copy link
Contributor

@moeshin moeshin commented Jan 1, 2022

No description provided.

If build is 32-bit and os is 64-bit, `has('win64')` will return `false`
```
if s:IsWindows()
    let job_cmd = [&shell, &shellcmdflag] + cmd
```
There are also two lines that affect the slow start ≈ 1000ms (no fix):
* 104: system('uname -s')
* 108: system('uname -m')
let s:home = expand("$HOME")
endif
if has('win32')
Copy link
Member

Choose a reason for hiding this comment

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

Would it hurt to always replace \ with /, even when not on Windows?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tested on Windows 11, Msys2 and WSL no problem.

@@ -90,13 +95,16 @@ let s:VERSION = '9.0.1'
" Detect os and architecture
if s:IsWindows()
let s:osname = "windows"
if has("win64")
if has("win64") || isdirectory(expand('$WINDIR') . '\SysWOW64')
Copy link
Member

Choose a reason for hiding this comment

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

Let's be extra careful and do:

if has("win64") || exists('$WINDIR') && isdirectory(expand('$WINDIR') . '\SysWOW64')

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. I don't know if there is any other better way to detect 64-bit.

Copy link
Member

@alanhamlett alanhamlett left a comment

Choose a reason for hiding this comment

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

I'll make the changes from my comments after merging. Thanks!

@alanhamlett alanhamlett merged commit 4f5301d into wakatime:master Jan 1, 2022
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.

None yet

2 participants