下面由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路径。
的原因是什么