1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-26 03:28:02 +02:00

Embedded console / terminal support

This commit is contained in:
Brian Fiete 2024-07-23 07:56:23 +02:00
parent 60817eec48
commit 20a8e3327c
28 changed files with 2317 additions and 690 deletions

View file

@ -10,15 +10,51 @@ using Beefy.widgets;
using Beefy.events;
using System.Diagnostics;
using Beefy.utils;
using IDE.util;
namespace IDE.ui;
class TerminalPanel : Panel
class TerminalPanel : ConsolePanel
{
public override void Serialize(StructuredData data)
{
base.Serialize(data);
data.Add("Type", "TerminalPanel");
}
public override void Init()
{
var consoleProvider = new BeefConConsoleProvider();
consoleProvider.mBeefConExePath = new $"{gApp.mInstallDir}/BeefCon.exe";
consoleProvider.mTerminalExe = new .(gApp.mSettings.mWindowsTerminal);
mConsoleProvider = consoleProvider;
}
public override void AddedToParent()
{
var consoleProvider = (BeefConConsoleProvider)mConsoleProvider;
consoleProvider.mTerminalExe.Set(gApp.mSettings.mWindowsTerminal);
consoleProvider.mWorkingDir.Set(gApp.mWorkspace.mDir);
mConsoleProvider.Attach();
}
public override void RemovedFromParent(Widget previousParent, WidgetWindow window)
{
}
public override void Update()
{
base.Update();
}
public void OpenDirectory(StringView path)
{
var consoleProvider = (BeefConConsoleProvider)mConsoleProvider;
consoleProvider.mWorkingDir.Set(path);
consoleProvider.Detach();
consoleProvider.Attach();
}
}