diff --git a/ShiftOS-TheRevival/MainForms/Terminal.vb b/ShiftOS-TheRevival/MainForms/Terminal.vb index a6840e3..4874534 100644 --- a/ShiftOS-TheRevival/MainForms/Terminal.vb +++ b/ShiftOS-TheRevival/MainForms/Terminal.vb @@ -10,11 +10,11 @@ Public Class Terminal Public StoryToTell As String Public ChangeInterpreter As Boolean = False Public CurrentInterpreter As String = "terminal" - Public CommandCache(4) As String Private Sub Terminal_Load(sender As Object, e As EventArgs) Handles MyBase.Load FormBorderStyle = FormBorderStyle.None WindowState = FormWindowState.Maximized + Cursor.Hide() InitializeTerminal() End Sub @@ -148,6 +148,10 @@ Public Class Terminal If Strings.AvailableFeature(2) = 1 Then TextBox1.Text = TextBox1.Text & Environment.NewLine & "PRINT Prints a corresponding text entered in the command" End If + TextBox1.Text = TextBox1.Text & Environment.NewLine & "REBOOT Terminate and re-run ShiftOS session" + If Strings.AvailableFeature(8) = 1 Then + TextBox1.Text = TextBox1.Text & Environment.NewLine & "SHIFTFETCH Shows informations about your computer" + End If TextBox1.Text = TextBox1.Text & Environment.NewLine & "SHIFTORIUM A software center for upgrading features on ShiftOS" TextBox1.Text = TextBox1.Text & Environment.NewLine & "SHUTDOWN Terminate ShiftOS session" TextBox1.Text = TextBox1.Text & Environment.NewLine & "SU Runs terminal as super user" @@ -166,6 +170,11 @@ 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 @@ -218,6 +227,7 @@ Public Class Terminal BadCommand = False Undeveloped() Case "shutdown", "shut down" + Cursor.Show() ShiftOSMenu.Show() Close() Case "time" @@ -287,6 +297,16 @@ Public Class Terminal TextBox1.Text = TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_print & Environment.NewLine BadCommand = False End If + Case "reboot" + TempUsage = TempUsage & "reboot" + TextBox1.Text = TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_reboot & Environment.NewLine + BadCommand = False + Case "shiftfetch" + If Strings.AvailableFeature(8) = "1" Then + TempUsage = TempUsage & "shiftfetch" + TextBox1.Text = TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_shiftfetch & Environment.NewLine + BadCommand = False + End If Case "shiftorium" TempUsage = TempUsage & "shiftorium [option] [featureName]" TextBox1.Text = TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_shiftorium & Environment.NewLine @@ -338,85 +358,89 @@ Public Class Terminal End Sub Private Sub txtterm_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown - If e.KeyCode = Keys.T AndAlso e.Control Then - Me.Hide() - e.SuppressKeyPress = True - End If + If CurrentInterpreter = "pause" Then + TerminateApp() + Else + 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 - 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 + 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 + 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 + 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 End If - Case Keys.Left + + '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 + Else + TrackPos = TrackPos + 1 + End If + End If + + If e.KeyCode = Keys.Back Then 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 - 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 - 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 - 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 - e.SuppressKeyPress = True + If TextBox1.SelectedText.Length < 1 Then + TrackPos = TrackPos - 1 + Else + e.SuppressKeyPress = True + End If End If End If End If diff --git a/ShiftOS-TheRevival/MainForms/TerminalApps.vb b/ShiftOS-TheRevival/MainForms/TerminalApps.vb index b493118..517dfd2 100644 --- a/ShiftOS-TheRevival/MainForms/TerminalApps.vb +++ b/ShiftOS-TheRevival/MainForms/TerminalApps.vb @@ -21,7 +21,12 @@ Terminal.CurrentInterpreter = "guess" GTN_GenerateNumber() ShouldChange = True - Case "shiftoriumfx" + Case "pause" 'Pause function + Terminal.DefaultPrompt = "Press any key to continue..." + Terminal.CurrentInterpreter = "pause" + Terminal.TextBox1.ReadOnly = True + ShouldChange = True + Case "shiftoriumfx" 'ShiftoriumFX : Advanced Shiftorium Terminal.DefaultPrompt = "Navigate> " Terminal.CurrentInterpreter = "shiftoriumfx" ShiftoriumFX_DisplayPackages() @@ -39,6 +44,7 @@ Terminal.CurrentInterpreter = "terminal" Terminal.PrintPrompt() Terminal.AssignPrompt() + Terminal.TextBox1.ReadOnly = False End Sub Public Sub DoChildCommand() @@ -54,9 +60,11 @@ Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "Invalid value!" End Try End Select + Case "pause" + TerminateApp() Case "shiftoriumfx" Select Case Terminal.command - Case "" + 'Case "" Case "exit" TerminateApp() diff --git a/ShiftOS-TheRevival/My Project/Resources.Designer.vb b/ShiftOS-TheRevival/My Project/Resources.Designer.vb index 9ce02a8..1757b17 100644 --- a/ShiftOS-TheRevival/My Project/Resources.Designer.vb +++ b/ShiftOS-TheRevival/My Project/Resources.Designer.vb @@ -70,7 +70,7 @@ Namespace My.Resources End Property ''' - ''' Looks up a localized string similar to 0.2.1. + ''' Looks up a localized string similar to 0.2.2. ''' Friend ReadOnly Property CurrentVersion() As String Get @@ -128,7 +128,7 @@ Namespace My.Resources End Property ''' - ''' Looks up a localized string similar to . + ''' Looks up a localized string similar to Prints a corresponding text entered in the command. ''' Friend ReadOnly Property man_print() As String Get @@ -136,6 +136,25 @@ Namespace My.Resources End Get End Property + ''' + ''' Looks up a localized string similar to Terminate ShiftOS session and re-running the session. + ''' + Friend ReadOnly Property man_reboot() As String + Get + Return ResourceManager.GetString("man_reboot", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to Command-line system information tool for ShiftOS + '''Ported from Neofetch. + ''' + Friend ReadOnly Property man_shiftfetch() As String + Get + Return ResourceManager.GetString("man_shiftfetch", resourceCulture) + End Get + End Property + ''' ''' Looks up a localized string similar to A software center for upgrading features in ShiftOS ''' diff --git a/ShiftOS-TheRevival/My Project/Resources.resx b/ShiftOS-TheRevival/My Project/Resources.resx index 07ea33f..d135df8 100644 --- a/ShiftOS-TheRevival/My Project/Resources.resx +++ b/ShiftOS-TheRevival/My Project/Resources.resx @@ -142,6 +142,12 @@ ..\resources\man manuals\print.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + ..\resources\man manuals\reboot.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\resources\man manuals\shiftfetch.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + ..\resources\man manuals\shiftorium.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 diff --git a/ShiftOS-TheRevival/Resources/man Manuals/reboot.txt b/ShiftOS-TheRevival/Resources/man Manuals/reboot.txt new file mode 100644 index 0000000..06ce966 --- /dev/null +++ b/ShiftOS-TheRevival/Resources/man Manuals/reboot.txt @@ -0,0 +1 @@ +Terminate ShiftOS session and re-running the session \ No newline at end of file diff --git a/ShiftOS-TheRevival/Resources/man Manuals/shiftfetch.txt b/ShiftOS-TheRevival/Resources/man Manuals/shiftfetch.txt new file mode 100644 index 0000000..7faa84c --- /dev/null +++ b/ShiftOS-TheRevival/Resources/man Manuals/shiftfetch.txt @@ -0,0 +1,2 @@ +Command-line system information tool for ShiftOS +Ported from Neofetch \ No newline at end of file diff --git a/ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj b/ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj index a36a0d6..be2ccfc 100644 --- a/ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj +++ b/ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj @@ -202,6 +202,8 @@ + +