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

Windows: HOME with a space: causes script errors (scripts not found) #4721

Open
franckspike opened this issue Oct 11, 2022 · 3 comments
Open
Labels
can-not-reproduce Can not reproduce this issue

Comments

@franckspike
Copy link

franckspike commented Oct 11, 2022

Expected behavior, english is required

The reproduce ways from Vim starting (Required!)

Try to create a user with a space in its name under Windows.
And try to install and use SpaceVim normally…
Some path inside &runtimepath (rtp) become
C:/Users/First/ Last/… instead of C:/Users/First Last/…

Output of the :SPDebugInfo!

Screenshots

If you have any screenshots for this issue, please upload here. BTW you can use https://asciinema.org/ for recording video in terminal.

@wsdjeg
Copy link
Owner

wsdjeg commented Oct 19, 2022

seems same as #4722

@franckspike
Copy link
Author

franckspike commented Oct 19, 2022

Here are my in-code comments

in main.vim line 19

"let g:_spacevim_root_dir = escape(fnamemodify(resolve(fnamemodify(expand(''),
" \ ':p:h:gs?\?'.((has('win16') || has('win32')
" \ || has('win64'))?'':'/') . '?')), ':p:gs?[\/]?/?'), ' ')
" Buf fix
" g:_spacevim_root_dir cannot contain a space or it will become escaped by \
" and then \ are replaced by /. C:\Users\FirstName LastName would become
" C:/Users/FirstName/ LastName which is an error.
let g:_spacevim_root_dir="C:/Users/FLastName/.SpaceVim/"

where FLastName is a hard link (junction) to C:\Users\FirstName LastName\ without a space

I also realized that other location in SpaceVim’s code are getting the HOME directory wrong, even after fixing g:_spacevim_root_dir

So I also changed my HOME environment variable to the new path without space
C:\Users\FLastName

I did this in init.vim line 9

let $HOME='C:\Users\FLastName'

NOTE
this is a quick-fix patch and is not a working solution to be merged in the code for everyone (of course)

@wsdjeg
Copy link
Owner

wsdjeg commented Jul 7, 2024

I can not reproduce it now.

@wsdjeg wsdjeg added the can-not-reproduce Can not reproduce this issue label Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
can-not-reproduce Can not reproduce this issue
Projects
None yet
Development

No branches or pull requests

2 participants