您好,登錄后才能下訂單哦!
本篇內(nèi)容主要講解“Sublime如何更改Powershell為CMD”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實用性強。下面就讓小編來帶大家學習“Sublime如何更改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':
想必小伙伴們已經(jīng)看出來了,其實就是將Powershell判斷注釋掉,只要是Windows,就直接將Terminal路徑設置為cmd路徑。
到此,相信大家對“Sublime如何更改Powershell為CMD”有了更深的了解,不妨來實際操作一番吧!這里是億速云網(wǎng)站,更多相關(guān)內(nèi)容可以進入相關(guān)頻道進行查詢,關(guān)注我們,繼續(xù)學習!
免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。