Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to change Powershell to CMD by Sublime

Shulou Source: shulou.com Published: 2022-06-01 10:02:25 09月26日 Update

This article mainly explains "Sublime how to change Powershell to CMD", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let Xiaobian take you to learn "Sublime how to change Powershell to CMD"!

Sublime Terminal Plugin Change Powershell to CMD under Win7

As for why you want to change it, I'm sure you don't want to install Powershell, just like me, although it's powerful, powerful...

Not much to say, please see the operation:

Find the plugin installation location and modify the "Terminal.py" file:

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':

Presumably the little friends have already seen it, in fact, is to comment off the Powershell judgment, as long as it is Windows, directly set the Terminal path to cmd path.

At this point, I believe that everyone has a deeper understanding of "Sublime how to change Powershell to CMD", may wish to actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!

Tags: Powerful content plug-ins paths learning practical deeper location interest practicality practicality guys buddies that is easy to operate files methods more friends comments Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Shulou Tech Info Redmi MariaDB Microsoft