mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-19 00:20:25 +02:00
Added an open in terminal dialogue
This commit is contained in:
parent
efb1a9c350
commit
8f7287b3dc
5 changed files with 69 additions and 0 deletions
|
@ -2989,6 +2989,39 @@ namespace IDE.ui
|
|||
process.Start(psi).IgnoreError();
|
||||
}
|
||||
});
|
||||
|
||||
item = menu.AddItem("Open in Terminal");
|
||||
item.mOnMenuItemSelected.Add(new (menu) =>
|
||||
{
|
||||
let projectItem = GetSelectedProjectItem();
|
||||
String path = scope String();
|
||||
if (projectItem == null)
|
||||
{
|
||||
path.Set(gApp.mWorkspace.mDir);
|
||||
}
|
||||
else if (let projectFolder = projectItem as ProjectFolder)
|
||||
{
|
||||
if (projectFolder.mParentFolder == null)
|
||||
{
|
||||
path.Set(projectFolder.mProject.mProjectDir);
|
||||
}
|
||||
else
|
||||
projectFolder.GetFullImportPath(path);
|
||||
}
|
||||
else
|
||||
projectItem.mParentFolder.GetFullImportPath(path);
|
||||
|
||||
if (!path.IsWhiteSpace)
|
||||
{
|
||||
ProcessStartInfo psi = scope ProcessStartInfo();
|
||||
psi.SetFileName(gApp.mSettings.mEditorSettings.mDefaultConsole);
|
||||
psi.SetWorkingDirectory(path);
|
||||
psi.UseShellExecute = true;
|
||||
|
||||
var process = scope SpawnedProcess();
|
||||
process.Start(psi).IgnoreError();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (projectItem == null)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue