Maison  >  Article  >  outils de développement  >  Comment changer Powershell en CMD dans Sublime

Comment changer Powershell en CMD dans Sublime

藏色散人
藏色散人avant
2021-12-21 17:03:123228parcourir

La colonne tutorielle suivante de sublime vous présentera comment changer Powershell en CMD sous le plug-in Sublime Terminal Win7. J'espère que cela sera utile aux amis dans le besoin !

Comment changer Powershell en CMD dans Sublime

Plugin Sublime Terminal pour changer Powershell en CMD sous Win7

Quant à la raison pour laquelle vous voulez changer, je pense que vous devez être comme moi et que vous ne voulez pas installer Powershell, même si c'est le cas très puissant et puissant...

Mots Pas grand chose à dire, merci de voir le fonctionnement si nécessaire :

Trouvez l'emplacement d'installation du plug-in et modifiez le fichier "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':

Je crois que vous avez Je l'ai déjà compris. En fait, cela signifie commenter le jugement Powershell. Tant qu'il s'agit de Windows, vous pouvez définir directement le chemin du terminal sur le chemin cmd.


Ce qui précède est le contenu détaillé de. pour plus d'informations, suivez d'autres articles connexes sur le site Web de PHP en chinois!

Déclaration:
Cet article est reproduit dans:. en cas de violation, veuillez contacter admin@php.cn Supprimer