wbond / sublime_terminal

Launch terminals from the current file or the root project folder
https://packagecontrol.io/packages/Terminal
MIT License
597 stars 117 forks source link

x86 cant be recognized #170

Open strange-jiong opened 7 years ago

strange-jiong commented 7 years ago

win 10 sublime text2 3126

x86 : 无法将“x86”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确, 然后再试一次。 所在位置 行:1 字符: 21

twolfson commented 7 years ago

Do you have a custom configuration set up for Sublime Terminal?

strange-jiong commented 7 years ago

no just the original code. I test the code in terminal.py line 82:

            buf = create_unicode_buffer(512)
            if windll.kernel32.GetShortPathNameW(sublime_terminal_path, buf, len(buf)):
                sublime_terminal_path = buf.value
            os.environ['sublime_terminal_path'] = sublime_terminal_path.replace(' ', '` ')

the channge to short path cant work in my computer win10

twolfson commented 7 years ago

Ah, good eye. It looks like Windows should support environment variables up to 2048 characters:

https://blogs.msdn.microsoft.com/oldnewthing/20100203-00/?p=15083

@wbond Could you give us more context behind this code?

wbond commented 7 years ago

@twolfson This handles non-ASCII file paths in Sublime Text 2. The short path name in Windows is guaranteed to be ASCII, sidestepping issues with the bytes-only APIs that are prevalent in Python 2.x. These issues were one of the primary motivators for Sublime Text jumping to quickly from ST2 stable to ST3 beta. Python 3.3 resolved all sort of unicode issues, although some of the edge cases weren't fully fixed until Python 3.6, released just 9 months ago(!).