Sublime怎么更改Powershell为CMD

下面由sublime教程栏目给大家介绍关于Sublime Terminal插件Win7下怎么更改Powershell为CMD,希望对需要的朋友有所帮助!

Sublime Terminal插件Win7下更改Powershell为CMD

至于为什么要更改,我想你肯定也和我一样,不想装Powershell,尽管它很强大,很强大…

话不多说,需要的请看操作:

找到插件安装位置,修改”Terminal.py”文件:

if os.name == \’nt\’: # if os.path.exists(os.environ[\’SYSTEMROOT\’] # \’\\\\System32\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe\’): # # This mimics the default powershell colors since calling # # subprocess.POpen() ends up acting like launching powershell # # from cmd.exe. Normally the size and color are inherited # # from cmd.exe, but this creates a custom mapping, and then # # the LaunchPowerShell.bat file adjusts some other settings. # key_string = \’Console\\\\%SystemRoot%_system32_\’ # \’WindowsPowerShell_v1.0_powershell.exe\’ # try: # key = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, # key_string) # except (WindowsError): # key = _winreg.CreateKey(_winreg.HKEY_CURRENT_USER, # key_string) # _winreg.SetValueEx(key, \’ColorTable05\’, 0, # _winreg.REG_DWORD, 5645313) # _winreg.SetValueEx(key, \’ColorTable06\’, 0, # _winreg.REG_DWORD, 15789550) # default = os.path.join(package_dir, \’PS.bat\’) # sublime_terminal_path = os.path.join(sublime.packages_path(), installed_dir) # # This should turn the path into an 8.3-style path, getting around unicode # # issues and spaces # buf = create_unicode_buffer(512) # if windll.kernel32.GetShortPathNameW(sublime_terminal_path, buf, len(buf)): # sublime_terminal_path = buf.value # os.putenv(\’sublime_terminal_path\’, sublime_terminal_path.replace(\’ \’, \’` \’)) # else : default = os.environ[\’SYSTEMROOT\’] \’\\\\System32\\\\cmd.exe\’ elif sys.platform == \’darwin\’:

想必小伙伴们已经看出来了,其实就是将Powershell判断注释掉,只要是Windows,就直接将Terminal路径设置为cmd路径。

更多关于云服务器域名注册虚拟主机的问题,请访问西部数码官网:www.west.cn

赞(0)
声明:本网站发布的内容(图片、视频和文字)以原创、转载和分享网络内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-62778877-8306;邮箱:fanjiao@west.cn。本站原创内容未经允许不得转载,或转载时需注明出处:西部数码知识库 » Sublime怎么更改Powershell为CMD

登录

找回密码

注册