sublime_terminal icon indicating copy to clipboard operation
sublime_terminal copied to clipboard

x86 cant be recognized

Open strange-jiong opened this issue 8 years ago • 4 comments

win 10 sublime text2 3126

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

  • D:\Program Files (x86)\Sublime Text Build 3083 x64\Data\Package ...

strange-jiong avatar May 21 '17 02:05 strange-jiong

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

twolfson avatar May 21 '17 04:05 twolfson

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

strange-jiong avatar May 21 '17 05:05 strange-jiong

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?

twolfson avatar May 21 '17 05:05 twolfson

@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(!).

wbond avatar Aug 01 '17 14:08 wbond