private void OpenCmd(object sender, EventArgs e)
        {
            string installDir    = VsHelpers.GetInstallDirectory(this);
            string devPromptFile = Path.Combine(installDir, @"..\Tools\VsDevCmd.bat");

            SetupProcess("cmd.exe", "/k \"" + devPromptFile + "\"");
        }
Exemple #2
0
        private void OpenCmd(object sender, EventArgs e)
        {
            Options options = GetDialogPage(typeof(Options)) as Options;
            string  folder  = VsHelpers.GetFolderPath(options, _dte);

            string installDir    = VsHelpers.GetInstallDirectory(this);
            string devPromptFile = Path.Combine(installDir, @"..\Tools\VsDevCmd.bat");

            StartProcess(folder, "cmd.exe", "/k \"" + devPromptFile + "\"");
        }
        public override void LoadSettingsFromStorage()
        {
            _isLoading = true;

            base.LoadSettingsFromStorage();

            if (string.IsNullOrEmpty(Command))
            {
                Command = "cmd.exe";
            }

            if (string.IsNullOrEmpty(FriendlyName))
            {
                FriendlyName = "Default (cmd)";
            }

            if (string.IsNullOrEmpty(Preset))
            {
                Preset = "cmd";
            }

            if (DefaultPresets.Count == 0)
            {
                string installDir    = VsHelpers.GetInstallDirectory();
                string devPromptFile = Path.Combine(installDir, @"..\Tools\VsDevCmd.bat");

                DefaultPresets["cmd"]            = new Command("cmd.exe");
                DefaultPresets["Dev Cmd Prompt"] = new Command("cmd.exe", "/k \"" + devPromptFile + "\"");
                DefaultPresets["PowerShellCore"] = new Command("pwsh.exe", "-ExecutionPolicy Bypass -NoExit");
                DefaultPresets["PowerShell"]     = new Command("powershell.exe", "-ExecutionPolicy Bypass -NoExit");
                DefaultPresets["PowerShell ISE"] = new Command("powershell_ise.exe");
                DefaultPresets["posh-git"]       = new Command("powershell.exe", @"-ExecutionPolicy Bypass -NoExit -Command .(Resolve-Path ""$env:LOCALAPPDATA\GitHub\shell.ps1""); .(Resolve-Path ""$env:github_posh_git\profile.example.ps1"")");
                DefaultPresets["Git Bash"]       = new Command(@"C:\Program Files\Git\git-bash.exe");
                DefaultPresets["Babun"]          = new Command(@"%UserProfile%\.babun\cygwin\bin\mintty.exe", "/bin/env CHERE_INVOKING=1 /bin/zsh.exe");

                string GitHubForWindowsPath = Path.Combine(Environment.GetEnvironmentVariable("LocalAppData"), "GitHub", "GitHub.appref-ms");
                if (File.Exists(GitHubForWindowsPath))
                {
                    DefaultPresets["GitHub Console"] = new Command(@"%LOCALAPPDATA%\GitHub\GitHub.appref-ms", "-open-shell");
                }

                DefaultPresets["cmder"]  = new Command("cmder.exe", "/START \"%folder%\"");
                DefaultPresets["ConEmu"] = new Command("ConEmu64.exe", "/cmd PowerShell.exe");
                DefaultPresets["Custom"] = new Command(string.Empty, string.Empty);
            }

            _isLoading = false;
        }
Exemple #4
0
        public override void LoadSettingsFromStorage()
        {
            _isLoading = true;

            base.LoadSettingsFromStorage();

            if (string.IsNullOrEmpty(Command))
            {
                Command = "cmd.exe";
            }

            if (string.IsNullOrEmpty(Preset))
            {
                Preset = "cmd";
            }

            if (DefaultPresets.Count == 0)
            {
                string installDir    = VsHelpers.GetInstallDirectory(ServiceProvider.GlobalProvider);
                string devPromptFile = Path.Combine(installDir, @"..\Tools\VsDevCmd.bat");

                DefaultPresets["cmd"]            = new Command("cmd.exe");
                DefaultPresets["Dev Cmd Prompt"] = new Command("cmd.exe", "/k \"" + devPromptFile + "\"");
                DefaultPresets["PowerShell"]     = new Command("powershell.exe", "-ExecutionPolicy Bypass -NoExit");
                DefaultPresets["posh-git"]       = new Command("powershell.exe", @"-ExecutionPolicy Bypass -NoExit -Command .(Resolve-Path ""$env:LOCALAPPDATA\GitHub\shell.ps1""); .(Resolve-Path ""$env:github_posh_git\profile.example.ps1"")");

                string GitHubForWindowsPath = Path.Combine(Environment.GetEnvironmentVariable("LocalAppData"), "GitHub", "GitHub.appref-ms");
                if (File.Exists(GitHubForWindowsPath))
                {
                    DefaultPresets["GitHub Console"] = new Command(@"%LOCALAPPDATA%\GitHub\GitHub.appref-ms", "-open-shell");
                }

                DefaultPresets["cmder"]  = new Command("cmder.exe", "/START %folder%");
                DefaultPresets["Custom"] = new Command(string.Empty, string.Empty);
            }

            _isLoading = false;
        }