aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS-TheRevival/MainForms/Terminal.vb
diff options
context:
space:
mode:
authorEverythingWindows <[email protected]>2022-11-05 22:24:30 +0700
committerEverythingWindows <[email protected]>2022-11-05 22:24:30 +0700
commited6f6ee29d5d29a6e06cb15fadb4c0e3520c6e40 (patch)
tree8e685413564e5d18e43bd29f248ed5d097954432 /ShiftOS-TheRevival/MainForms/Terminal.vb
parent06623f4cb1e7db88d59a429abc7f0a985dc0eea6 (diff)
downloadshiftos-therevival-old-ed6f6ee29d5d29a6e06cb15fadb4c0e3520c6e40.tar.gz
shiftos-therevival-old-ed6f6ee29d5d29a6e06cb15fadb4c0e3520c6e40.tar.bz2
shiftos-therevival-old-ed6f6ee29d5d29a6e06cb15fadb4c0e3520c6e40.zip
bc finally freaking worked
Diffstat (limited to 'ShiftOS-TheRevival/MainForms/Terminal.vb')
-rw-r--r--ShiftOS-TheRevival/MainForms/Terminal.vb150
1 files changed, 77 insertions, 73 deletions
diff --git a/ShiftOS-TheRevival/MainForms/Terminal.vb b/ShiftOS-TheRevival/MainForms/Terminal.vb
index 4874534..007fdad 100644
--- a/ShiftOS-TheRevival/MainForms/Terminal.vb
+++ b/ShiftOS-TheRevival/MainForms/Terminal.vb
@@ -108,6 +108,13 @@ Public Class Terminal
Case ""
AdvancedCommand = False
BadCommand = False
+ Case "bc"
+ If Strings.AvailableFeature(9) = "1" Then
+ ChangeInterpreter = True
+ AppHost("bc")
+ AdvancedCommand = False
+ BadCommand = False
+ End If
Case "clear"
If Strings.AvailableFeature(1) = "1" Then
TextBox1.Text = Nothing
@@ -170,11 +177,6 @@ Public Class Terminal
TextBox1.Text = TextBox1.Text & Environment.NewLine
AdvancedCommand = False
BadCommand = False
- Case "pause"
- ChangeInterpreter = True
- AppHost("pause")
- AdvancedCommand = False
- BadCommand = False
Case "reboot"
TextBox1.Text = Nothing
AdvancedCommand = False
@@ -267,6 +269,12 @@ Public Class Terminal
Dim TempUsage As String = "'" & mancommand & "' Usage: "
Select Case mancommand
'In process to convert every command from printing from code to printing from text file
+ Case "bc"
+ If Strings.AvailableFeature(9) = "1" Then
+ TempUsage = TempUsage & "bc"
+ TextBox1.Text = TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_bc & Environment.NewLine
+ BadCommand = False
+ End If
Case "clear"
If Strings.AvailableFeature(1) = "1" Then
TempUsage = TempUsage & "clear"
@@ -358,89 +366,85 @@ Public Class Terminal
End Sub
Private Sub txtterm_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
- If CurrentInterpreter = "pause" Then
- TerminateApp()
- Else
- If e.KeyCode = Keys.T AndAlso e.Control Then
- Me.Hide()
- e.SuppressKeyPress = True
- End If
+ If e.KeyCode = Keys.T AndAlso e.Control Then
+ Me.Hide()
+ e.SuppressKeyPress = True
+ End If
- Select Case e.KeyCode
- Case Keys.ShiftKey
- TrackPos = TrackPos - 1
- Case Keys.Alt
+ Select Case e.KeyCode
+ Case Keys.ShiftKey
+ TrackPos = TrackPos - 1
+ Case Keys.Alt
+ TrackPos = TrackPos - 1
+ Case Keys.CapsLock
+ TrackPos = TrackPos - 1
+ Case Keys.ControlKey
+ TrackPos = TrackPos - 1
+ Case Keys.LWin
+ TrackPos = TrackPos - 1
+ Case Keys.RWin
+ TrackPos = TrackPos - 1
+ Case Keys.Right
+ If TextBox1.SelectionStart = TextBox1.TextLength Then
TrackPos = TrackPos - 1
- Case Keys.CapsLock
- TrackPos = TrackPos - 1
- Case Keys.ControlKey
- TrackPos = TrackPos - 1
- Case Keys.LWin
- TrackPos = TrackPos - 1
- Case Keys.RWin
- TrackPos = TrackPos - 1
- Case Keys.Right
- If TextBox1.SelectionStart = TextBox1.TextLength Then
- TrackPos = TrackPos - 1
- End If
- Case Keys.Left
- If TrackPos < 1 Then
- e.SuppressKeyPress = True
- TrackPos = TrackPos - 1
- Else
- TrackPos = TrackPos - 2
- End If
- Case Keys.Up
- e.SuppressKeyPress = True
- TrackPos = TrackPos - 1
- Case Keys.Down
+ End If
+ Case Keys.Left
+ If TrackPos < 1 Then
e.SuppressKeyPress = True
TrackPos = TrackPos - 1
- End Select
-
- If e.KeyCode = Keys.Enter Then
- e.SuppressKeyPress = True
- If TextBox1.ReadOnly = True Then
-
Else
- ReadCommand()
- If ChangeInterpreter = True Then
- DoChildCommand()
- PrintPrompt()
- TextBox1.Select(TextBox1.Text.Length, 0)
- Else
- DoCommand()
- PrintPrompt()
- TextBox1.Select(TextBox1.Text.Length, 0)
- End If
+ TrackPos = TrackPos - 2
End If
+ Case Keys.Up
+ e.SuppressKeyPress = True
+ TrackPos = TrackPos - 1
+ Case Keys.Down
+ e.SuppressKeyPress = True
+ TrackPos = TrackPos - 1
+ End Select
- 'If command = "clear" Then
- ' PrintPrompt()
- ' TextBox1.Select(TextBox1.Text.Length, 0)
-
- 'Else
- ' PrintPrompt()
- ' TextBox1.Select(TextBox1.Text.Length, 0)
- 'End If
+ If e.KeyCode = Keys.Enter Then
+ e.SuppressKeyPress = True
+ If TextBox1.ReadOnly = True Then
- TrackPos = 0
Else
- If e.KeyCode = Keys.Back Then
+ ReadCommand()
+ If ChangeInterpreter = True Then
+ DoChildCommand()
+ PrintPrompt()
+ TextBox1.Select(TextBox1.Text.Length, 0)
Else
- TrackPos = TrackPos + 1
+ DoCommand()
+ PrintPrompt()
+ TextBox1.Select(TextBox1.Text.Length, 0)
End If
End If
+ 'If command = "clear" Then
+ ' PrintPrompt()
+ ' TextBox1.Select(TextBox1.Text.Length, 0)
+
+ 'Else
+ ' PrintPrompt()
+ ' TextBox1.Select(TextBox1.Text.Length, 0)
+ 'End If
+
+ TrackPos = 0
+ Else
If e.KeyCode = Keys.Back Then
- If TrackPos < 1 Then
- e.SuppressKeyPress = True
+ Else
+ TrackPos = TrackPos + 1
+ End If
+ End If
+
+ If e.KeyCode = Keys.Back Then
+ If TrackPos < 1 Then
+ e.SuppressKeyPress = True
+ Else
+ If TextBox1.SelectedText.Length < 1 Then
+ TrackPos = TrackPos - 1
Else
- If TextBox1.SelectedText.Length < 1 Then
- TrackPos = TrackPos - 1
- Else
- e.SuppressKeyPress = True
- End If
+ e.SuppressKeyPress = True
End If
End If
End If