aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Main/ShiftOS
diff options
context:
space:
mode:
authorAlex-TIMEHACK <[email protected]>2017-11-18 16:46:45 +0000
committerAlex-TIMEHACK <[email protected]>2017-11-18 16:46:45 +0000
commit179ec19e6b49dd6c0f5de5dc6f69128338a28e12 (patch)
treeed547c04fbd541260e1d1fdb594a2850706e0d10 /ShiftOS.Main/ShiftOS
parent6faabfbbd86d70c99e197a3d8cfcf7db0680d17f (diff)
downloadshiftos-rewind-179ec19e6b49dd6c0f5de5dc6f69128338a28e12.tar.gz
shiftos-rewind-179ec19e6b49dd6c0f5de5dc6f69128338a28e12.tar.bz2
shiftos-rewind-179ec19e6b49dd6c0f5de5dc6f69128338a28e12.zip
I don't know WHAT git did but I fixed it.
Diffstat (limited to 'ShiftOS.Main/ShiftOS')
-rw-r--r--ShiftOS.Main/ShiftOS/Apps/Terminal.cs94
-rw-r--r--ShiftOS.Main/ShiftOS/Desktop.cs7
2 files changed, 29 insertions, 72 deletions
diff --git a/ShiftOS.Main/ShiftOS/Apps/Terminal.cs b/ShiftOS.Main/ShiftOS/Apps/Terminal.cs
index a5c5a11..5976cab 100644
--- a/ShiftOS.Main/ShiftOS/Apps/Terminal.cs
+++ b/ShiftOS.Main/ShiftOS/Apps/Terminal.cs
@@ -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)
+ TerminalBackend.trm.Add(this);
+ }
+
+ void Print()
+ {
+ termmain.AppendText($"\n {defaulttextResult}");
+ TrackingPosition = termmain.Text.Length;
+ }
+
+ void Print(string text)
{
- termmain.AppendText($"\n {text} \n {DefaulttextResult}");
+ 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;
- }
}
+ //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");
- }
}
}
diff --git a/ShiftOS.Main/ShiftOS/Desktop.cs b/ShiftOS.Main/ShiftOS/Desktop.cs
index 10eea41..4bf4805 100644
--- a/ShiftOS.Main/ShiftOS/Desktop.cs
+++ b/ShiftOS.Main/ShiftOS/Desktop.cs
@@ -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)
{