下面由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路径。
以上就是sublime怎么更改powershell为cmd的详细内容。