1
0
Fork 0
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:
Booklordofthedings 2024-07-16 12:49:15 +02:00
parent efb1a9c350
commit 8f7287b3dc
5 changed files with 69 additions and 0 deletions

View file

@ -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)