mirror of
https://github.com/ShiftOS-Rewind/ShiftOS.git
synced 2025-01-22 11:21:45 -05:00
I don't know WHAT git did but I fixed it.
This commit is contained in:
parent
6faabfbbd8
commit
179ec19e6b
5 changed files with 31 additions and 78 deletions
Binary file not shown.
|
@ -63,7 +63,6 @@
|
|||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Tools.cs" />
|
||||
<Compile Include="ShiftFS\ShiftDirectory.cs" />
|
||||
<Compile Include="ShiftFS\ShiftFileStream.cs" />
|
||||
<Compile Include="ShiftFS\ShiftTree.cs" />
|
||||
|
|
|
@ -102,9 +102,6 @@
|
|||
<Compile Include="Terminal\Commands\Hello.cs" />
|
||||
<Compile Include="Terminal\TerminalBackend.cs" />
|
||||
<Compile Include="Terminal\TerminalCommand.cs" />
|
||||
<EmbeddedResource Include="HijackScreen.resx">
|
||||
<DependentUpon>HijackScreen.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
|
|
|
@ -14,52 +14,48 @@ namespace ShiftOS.Main.ShiftOS.Apps
|
|||
public bool RunningCommand = false;
|
||||
public bool WaitingResponse = false;
|
||||
public string InputReturnText = "";
|
||||
using ShiftOS.Engine.Terminal;
|
||||
|
||||
namespace ShiftOS.Main.ShiftOS.Apps
|
||||
{
|
||||
public partial class Terminal : UserControl
|
||||
{
|
||||
public string DefaulttextBefore = "user> ";
|
||||
string DefaulttextResult = "user@shiftos> "; // NOT YET IMPLEMENTED!!!
|
||||
bool DoClear = false;
|
||||
|
||||
// The below variables makes the terminal... a terminal!
|
||||
string OldText = "";
|
||||
|
||||
int TrackingPosition;
|
||||
|
||||
termmain.ContextMenuStrip = new ContextMenuStrip(); // Disables the right click of a richtextbox!
|
||||
|
||||
TerminalBackend.trm.Add(this); // Makes the commands run!
|
||||
}
|
||||
public Terminal()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
termmain.ContextMenuStrip = new ContextMenuStrip(); // Disables the right click of a richtextbox!
|
||||
}
|
||||
|
||||
void Print(string text)
|
||||
{
|
||||
termmain.AppendText($"\n {text} \n {DefaulttextResult}");
|
||||
TrackingPosition = termmain.Text.Length;
|
||||
}
|
||||
if (e.Control && e.KeyCode == Keys.V)
|
||||
{
|
||||
//if (Clipboard.ContainsText())
|
||||
// termmain.Paste(DataFormats.GetFormat(DataFormats.Text));
|
||||
e.Handled = true;
|
||||
} else if (e.KeyCode == Keys.Enter) {
|
||||
RunningCommand = true;
|
||||
TerminalBackend.RunCommand(termmain.Text.Substring(TrackingPosition, termmain.Text.Length - TrackingPosition), TerminalID); // The most horrific line in the entire application!
|
||||
RunningCommand = false;
|
||||
termmain.AppendText($"\n {defaulttextResult}");
|
||||
TrackingPosition = termmain.Text.Length;
|
||||
e.Handled = true;
|
||||
}
|
||||
TerminalBackend.trm.Add(this);
|
||||
}
|
||||
|
||||
void Print()
|
||||
{
|
||||
termmain.AppendText($"\n {defaulttextResult}");
|
||||
TrackingPosition = termmain.Text.Length;
|
||||
}
|
||||
|
||||
void Print(string text)
|
||||
{
|
||||
termmain.AppendText($"\n {text} \n {defaulttextResult}");
|
||||
TrackingPosition = termmain.Text.Length;
|
||||
}
|
||||
|
||||
//if (e.Control && e.KeyCode == Keys.V)
|
||||
// {
|
||||
// //if (Clipboard.ContainsText())
|
||||
// // termmain.Paste(DataFormats.GetFormat(DataFormats.Text));
|
||||
// e.Handled = true;
|
||||
// } else if (e.KeyCode == Keys.Enter) {
|
||||
// RunningCommand = true;
|
||||
// TerminalBackend.RunCommand(termmain.Text.Substring(TrackingPosition, termmain.Text.Length - TrackingPosition), TerminalID); // The most horrific line in the entire application!
|
||||
// RunningCommand = false;
|
||||
// termmain.AppendText($"\n {defaulttextResult}");
|
||||
// TrackingPosition = termmain.Text.Length;
|
||||
// e.Handled = true;
|
||||
// }
|
||||
//}
|
||||
|
||||
private void termmain_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!RunningCommand)
|
||||
|
@ -113,8 +109,7 @@ namespace ShiftOS.Main.ShiftOS.Apps
|
|||
TrackingPosition = termmain.Text.Length;
|
||||
DoClear = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void termmain_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
// The below code disables the ability to paste anything other then text...
|
||||
|
@ -127,41 +122,10 @@ namespace ShiftOS.Main.ShiftOS.Apps
|
|||
}
|
||||
else if (e.KeyCode == Keys.Enter)
|
||||
{
|
||||
Print(
|
||||
TerminalBackend.RunCommand(
|
||||
termmain.Text.Substring(
|
||||
TrackingPosition,
|
||||
termmain.Text.Length - TrackingPosition))); // The most horrific line in the entire application!
|
||||
TerminalBackend.RunCommand(termmain.Text.Substring(TrackingPosition, termmain.Text.Length - TrackingPosition), TerminalID); // The most horrific line in the entire application!
|
||||
Print();
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
void termmain_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (termmain.SelectionStart < TrackingPosition)
|
||||
{
|
||||
if (DoClear) return;
|
||||
|
||||
termmain.Text = OldText;
|
||||
termmain.Select(termmain.Text.Length, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
OldText = termmain.Text;
|
||||
}
|
||||
}
|
||||
|
||||
void termmain_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (termmain.SelectionStart >= TrackingPosition) return;
|
||||
|
||||
termmain.Text = OldText;
|
||||
termmain.Select(termmain.Text.Length, 0);
|
||||
}
|
||||
|
||||
void Terminal_Load(object sender, EventArgs e)
|
||||
{
|
||||
Print("\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,13 +60,6 @@ namespace ShiftOS.Main.ShiftOS
|
|||
|
||||
ShiftWM.Init(trm, "Terminal", null, false, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
void terminalToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var trm = new Terminal();
|
||||
ShiftWM.Init(trm, "Terminal", null);
|
||||
}
|
||||
|
||||
void textPadToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue