Skip to content

Commit

Permalink
add button/command 'open in output'
Browse files Browse the repository at this point in the history
  • Loading branch information
dmateja committed Jun 20, 2017
1 parent 1a04f45 commit 4b9f705
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/OpenCommandLine/OpenCommandLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ internal sealed partial class PackageIds
public const int cmdidOpenPowershell = 0x0300;
public const int cmdidOpenOptions = 0x0400;
public const int cmdExecuteCmd = 0x0500;
public const int cmdidOpenCmdInOutput = 0x0600;
public const int @default = 0x0001;
public const int powershell = 0x0002;
public const int cmd = 0x0003;
Expand Down
10 changes: 10 additions & 0 deletions src/OpenCommandLine/OpenCommandLine.vsct
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@
<ButtonText>Default</ButtonText>
</Strings>
</Button>
<Button guid="guidOpenCommandLineCmdSet" id="cmdidOpenCmdInOutput" priority="0x0100" type="Button">
<Parent guid="guidOpenCommandLineCmdSet" id="DefaultMenuGroup" />
<Icon guid="guidImages" id="cmd" />
<Strings>
<CommandName>Open Command Line In Output</CommandName>
<ButtonText>CMD In Output</ButtonText>
</Strings>
</Button>
<Button guid="guidOpenCommandLineCmdSet" id="cmdidOpenCmd" priority="0x0100" type="Button">
<Parent guid="guidOpenCommandLineCmdSet" id="DefaultMenuGroup" />
<Icon guid="guidImages" id="cmd" />
Expand Down Expand Up @@ -85,6 +93,7 @@
<KeyBinding guid="guidOpenCommandLineCmdSet" id="cmdExecuteCmd" mod1="Alt Shift" key1="5" editor="guidVSStd97"/>
<KeyBinding guid="guidOpenCommandLineCmdSet" id="cmdidOpenCmd" mod1="Alt Shift" key1="VK_OEM_COMMA" editor="guidVSStd97"/>
<KeyBinding guid="guidOpenCommandLineCmdSet" id="cmdidOpenPowershell" mod1="Alt Shift" key1="VK_OEM_PERIOD" editor="guidVSStd97"/>
<KeyBinding guid="guidOpenCommandLineCmdSet" id="cmdidOpenCmdInOutput" mod1="Alt Shift" key1="VK_SPACE" editor="guidVSStd97"/>
</KeyBindings>

<CommandPlacements>
Expand Down Expand Up @@ -114,6 +123,7 @@
<IDSymbol name="cmdidOpenPowershell" value="0x0300" />
<IDSymbol name="cmdidOpenOptions" value="0x0400" />
<IDSymbol name="cmdExecuteCmd" value="0x0500" />
<IDSymbol name="cmdidOpenCmdInOutput" value="0x0600" />
</GuidSymbol>

<GuidSymbol name="guidImages" value="{bc10dceb-1833-4dac-bc42-286a81241664}" >
Expand Down
8 changes: 8 additions & 0 deletions src/OpenCommandLine/OpenCommandLinePackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ protected override void Initialize()
OleMenuCommand exeItem = new OleMenuCommand(ExecuteFile, cmdExe);
exeItem.BeforeQueryStatus += BeforeExeQuery;
mcs.AddCommand(exeItem);

CommandID cmdCmdInOutput = new CommandID(PackageGuids.guidOpenCommandLineCmdSet, PackageIds.cmdidOpenCmdInOutput);
MenuCommand cmdInOutput = new MenuCommand(OpenCmdInOutput, cmdCmdInOutput);
mcs.AddCommand( cmdInOutput );
}

void BeforeExeQuery(object sender, EventArgs e)
Expand Down Expand Up @@ -127,6 +131,10 @@ private void OpenPowershell(object sender, EventArgs e)
SetupProcess("powershell.exe", "-ExecutionPolicy Bypass -NoExit");
}

private void OpenCmdInOutput(object sender, EventArgs e)
{
}

private void SetupProcess(string command, string arguments)
{
Options options = GetDialogPage(typeof(Options)) as Options;
Expand Down

0 comments on commit 4b9f705

Please sign in to comment.