PAUSE function

This commit is contained in:
EverythingWindows 2022-11-05 06:27:35 +07:00
parent 60b6ce686d
commit 06623f4cb1
7 changed files with 140 additions and 78 deletions

View file

@ -10,11 +10,11 @@ Public Class Terminal
Public StoryToTell As String Public StoryToTell As String
Public ChangeInterpreter As Boolean = False Public ChangeInterpreter As Boolean = False
Public CurrentInterpreter As String = "terminal" Public CurrentInterpreter As String = "terminal"
Public CommandCache(4) As String
Private Sub Terminal_Load(sender As Object, e As EventArgs) Handles MyBase.Load Private Sub Terminal_Load(sender As Object, e As EventArgs) Handles MyBase.Load
FormBorderStyle = FormBorderStyle.None FormBorderStyle = FormBorderStyle.None
WindowState = FormWindowState.Maximized WindowState = FormWindowState.Maximized
Cursor.Hide()
InitializeTerminal() InitializeTerminal()
End Sub End Sub
@ -148,6 +148,10 @@ Public Class Terminal
If Strings.AvailableFeature(2) = 1 Then If Strings.AvailableFeature(2) = 1 Then
TextBox1.Text = TextBox1.Text & Environment.NewLine & "PRINT Prints a corresponding text entered in the command" TextBox1.Text = TextBox1.Text & Environment.NewLine & "PRINT Prints a corresponding text entered in the command"
End If 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 & "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 & "SHUTDOWN Terminate ShiftOS session"
TextBox1.Text = TextBox1.Text & Environment.NewLine & "SU Runs terminal as super user" 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 TextBox1.Text = TextBox1.Text & Environment.NewLine
AdvancedCommand = False AdvancedCommand = False
BadCommand = False BadCommand = False
Case "pause"
ChangeInterpreter = True
AppHost("pause")
AdvancedCommand = False
BadCommand = False
Case "reboot" Case "reboot"
TextBox1.Text = Nothing TextBox1.Text = Nothing
AdvancedCommand = False AdvancedCommand = False
@ -218,6 +227,7 @@ Public Class Terminal
BadCommand = False BadCommand = False
Undeveloped() Undeveloped()
Case "shutdown", "shut down" Case "shutdown", "shut down"
Cursor.Show()
ShiftOSMenu.Show() ShiftOSMenu.Show()
Close() Close()
Case "time" Case "time"
@ -287,6 +297,16 @@ Public Class Terminal
TextBox1.Text = TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_print & Environment.NewLine TextBox1.Text = TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_print & Environment.NewLine
BadCommand = False BadCommand = False
End If 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" Case "shiftorium"
TempUsage = TempUsage & "shiftorium [option] [featureName]" TempUsage = TempUsage & "shiftorium [option] [featureName]"
TextBox1.Text = TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_shiftorium & Environment.NewLine TextBox1.Text = TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_shiftorium & Environment.NewLine
@ -338,6 +358,9 @@ Public Class Terminal
End Sub End Sub
Private Sub txtterm_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown 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 If e.KeyCode = Keys.T AndAlso e.Control Then
Me.Hide() Me.Hide()
e.SuppressKeyPress = True e.SuppressKeyPress = True
@ -420,6 +443,7 @@ Public Class Terminal
End If End If
End If End If
End If End If
End If
TextBox1.Select(TextBox1.TextLength, 0) TextBox1.Select(TextBox1.TextLength, 0)
TextBox1.ScrollToCaret() TextBox1.ScrollToCaret()

View file

@ -21,7 +21,12 @@
Terminal.CurrentInterpreter = "guess" Terminal.CurrentInterpreter = "guess"
GTN_GenerateNumber() GTN_GenerateNumber()
ShouldChange = True 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.DefaultPrompt = "Navigate> "
Terminal.CurrentInterpreter = "shiftoriumfx" Terminal.CurrentInterpreter = "shiftoriumfx"
ShiftoriumFX_DisplayPackages() ShiftoriumFX_DisplayPackages()
@ -39,6 +44,7 @@
Terminal.CurrentInterpreter = "terminal" Terminal.CurrentInterpreter = "terminal"
Terminal.PrintPrompt() Terminal.PrintPrompt()
Terminal.AssignPrompt() Terminal.AssignPrompt()
Terminal.TextBox1.ReadOnly = False
End Sub End Sub
Public Sub DoChildCommand() Public Sub DoChildCommand()
@ -54,9 +60,11 @@
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "Invalid value!" Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "Invalid value!"
End Try End Try
End Select End Select
Case "pause"
TerminateApp()
Case "shiftoriumfx" Case "shiftoriumfx"
Select Case Terminal.command Select Case Terminal.command
Case "" 'Case ""
Case "exit" Case "exit"
TerminateApp() TerminateApp()

View file

@ -70,7 +70,7 @@ Namespace My.Resources
End Property End Property
'''<summary> '''<summary>
''' Looks up a localized string similar to 0.2.1. ''' Looks up a localized string similar to 0.2.2.
'''</summary> '''</summary>
Friend ReadOnly Property CurrentVersion() As String Friend ReadOnly Property CurrentVersion() As String
Get Get
@ -128,7 +128,7 @@ Namespace My.Resources
End Property End Property
'''<summary> '''<summary>
''' Looks up a localized string similar to . ''' Looks up a localized string similar to Prints a corresponding text entered in the command.
'''</summary> '''</summary>
Friend ReadOnly Property man_print() As String Friend ReadOnly Property man_print() As String
Get Get
@ -136,6 +136,25 @@ Namespace My.Resources
End Get End Get
End Property End Property
'''<summary>
''' Looks up a localized string similar to Terminate ShiftOS session and re-running the session.
'''</summary>
Friend ReadOnly Property man_reboot() As String
Get
Return ResourceManager.GetString("man_reboot", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Command-line system information tool for ShiftOS
'''Ported from Neofetch.
'''</summary>
Friend ReadOnly Property man_shiftfetch() As String
Get
Return ResourceManager.GetString("man_shiftfetch", resourceCulture)
End Get
End Property
'''<summary> '''<summary>
''' Looks up a localized string similar to A software center for upgrading features in ShiftOS ''' Looks up a localized string similar to A software center for upgrading features in ShiftOS
''' '''

View file

@ -142,6 +142,12 @@
<data name="man_print" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="man_print" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\man manuals\print.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value> <value>..\resources\man manuals\print.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data> </data>
<data name="man_reboot" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\man manuals\reboot.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="man_shiftfetch" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\man manuals\shiftfetch.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="man_shiftorium" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="man_shiftorium" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\man manuals\shiftorium.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value> <value>..\resources\man manuals\shiftorium.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data> </data>

View file

@ -0,0 +1 @@
Terminate ShiftOS session and re-running the session

View file

@ -0,0 +1,2 @@
Command-line system information tool for ShiftOS
Ported from Neofetch

View file

@ -202,6 +202,8 @@
<Content Include="Resources\man Manuals\help.txt" /> <Content Include="Resources\man Manuals\help.txt" />
<Content Include="Resources\man Manuals\man.txt" /> <Content Include="Resources\man Manuals\man.txt" />
<Content Include="Resources\man Manuals\print.txt" /> <Content Include="Resources\man Manuals\print.txt" />
<Content Include="Resources\man Manuals\reboot.txt" />
<Content Include="Resources\man Manuals\shiftfetch.txt" />
<Content Include="Resources\man Manuals\shiftorium.txt" /> <Content Include="Resources\man Manuals\shiftorium.txt" />
<Content Include="Resources\man Manuals\shutdown.txt" /> <Content Include="Resources\man Manuals\shutdown.txt" />
<Content Include="Resources\man Manuals\ver.txt" /> <Content Include="Resources\man Manuals\ver.txt" />