diff --git a/ShiftOS-TheRevival/MainForms/DirectoryManagements.vb b/ShiftOS-TheRevival/MainForms/DirectoryManagements.vb new file mode 100644 index 0000000..2aabee2 --- /dev/null +++ b/ShiftOS-TheRevival/MainForms/DirectoryManagements.vb @@ -0,0 +1,11 @@ +Module DirectoryManagements + Public Sub TerminalDirectories(TheDirectory As String) + Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "Contents of " & Terminal.Pseudodir & Environment.NewLine + Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "[DIR] 0 KB ." + Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "[DIR] 0 KB .." + For Each Dir As String In IO.Directory.GetDirectories(TheDirectory) + Dim dirinf As New IO.DirectoryInfo(Dir) + Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "[DIR] 0 KB " & dirinf.Name + Next + End Sub +End Module diff --git a/ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb b/ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb index 66766ce..a04ab37 100644 --- a/ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb +++ b/ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb @@ -106,8 +106,8 @@ Public Class ShiftOSMenu End Sub Private Sub CheckInstall() - If Directory.Exists(My.Computer.FileSystem.SpecialDirectories.Temp & "\ShiftOS\ShiftFS") = True Then - Dim WhatVersion As String = File.ReadAllText(My.Computer.FileSystem.SpecialDirectories.Temp & "\ShiftOS\version.txt") + If Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS\ShiftFS") = True Then + Dim WhatVersion As String = File.ReadAllText(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS\version.txt") If WhatVersion = My.Resources.CurrentVersion Then Else @@ -119,8 +119,8 @@ Public Class ShiftOSMenu ShiftOSUpdater.Show() End If Else - If Directory.Exists(My.Computer.FileSystem.SpecialDirectories.Temp & "\ShiftOS") = True Then - If Directory.Exists(My.Computer.FileSystem.SpecialDirectories.Temp & "\ShiftOS\ShiftFS") = True Then + If Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS") = True Then + If Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS\ShiftFS") = True Then Directory.CreateDirectory(My.Computer.FileSystem.GetTempFileName & "\ShiftOS\ShiftFS") End If Else diff --git a/ShiftOS-TheRevival/MainForms/Strings.vb b/ShiftOS-TheRevival/MainForms/Strings.vb index 1435a4a..9a24e9a 100644 --- a/ShiftOS-TheRevival/MainForms/Strings.vb +++ b/ShiftOS-TheRevival/MainForms/Strings.vb @@ -2,7 +2,7 @@ Public Shared OSInfo() As String Public Shared ComputerInfo(4) As String Public Shared IsFree As Boolean - Public Shared OnceInfo(2) As String + Public Shared OnceInfo(4) As String Public Shared AvailableFeature(15) As String Public Shared CLIInterpreter As String Public Shared SaveFile As String @@ -31,6 +31,7 @@ '1 = RootDirectory (0.2.3) (default : My.Computer.FileSystem.SpecialDirectories.Temp & "\ShiftOS\ShiftFS\") '2 = Infobar Boolean (0.2.3) (default : True) '3 = Color for Terminal (0.2.3) (default : 0F) + '4 = RootDirectoryString (0.2.3) (default : !) ' 'ComputerInfo Strings: '0 = Computer Name (0.1) (default : shiftos) diff --git a/ShiftOS-TheRevival/MainForms/Terminal.vb b/ShiftOS-TheRevival/MainForms/Terminal.vb index 199f68a..37e83df 100644 --- a/ShiftOS-TheRevival/MainForms/Terminal.vb +++ b/ShiftOS-TheRevival/MainForms/Terminal.vb @@ -11,6 +11,7 @@ Public Class Terminal Public ChangeInterpreter As Boolean = False Public CurrentInterpreter As String = "terminal" Public CurrentDirectory As String + Public Pseudodir As String Public StayAtChapter As Boolean = False Private Sub Terminal_Load(sender As Object, e As EventArgs) Handles MyBase.Load @@ -21,7 +22,8 @@ Public Class Terminal End Sub Public Sub InitializeTerminal() - Strings.OnceInfo(1) = My.Computer.FileSystem.SpecialDirectories.Temp & "\ShiftOS\ShiftFS\" + Strings.OnceInfo(1) = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS\ShiftFS\" + Strings.OnceInfo(4) = "!" If Strings.IsFree = True Then Strings.ComputerInfo(0) = "shiftos" Strings.ComputerInfo(1) = "user" @@ -49,6 +51,8 @@ Public Class Terminal End If End If End If + CurrentDirectory = Strings.OnceInfo(1) + Pseudodir = CurrentDirectory.Replace(Strings.OnceInfo(1), "!\") TextBox1.Select(TextBox1.TextLength, 0) TextBox1.ScrollToCaret() End Sub @@ -145,6 +149,10 @@ Public Class Terminal DisplayColors() AdvancedCommand = False BadCommand = False + Case "dir" + TerminalDirectories(CurrentDirectory) + AdvancedCommand = False + BadCommand = False Case "guess" ChangeInterpreter = True AppHost("guess") @@ -211,15 +219,6 @@ Public Class Terminal AdvancedCommand = False BadCommand = False InitializeTerminal() - Case "su" - If Strings.OnceInfo(0) = "Yes" Then - TextBox1.Text = TextBox1.Text & Environment.NewLine & "You already in root mode!" - Else - Strings.OnceInfo(0) = "Yes" - AssignPrompt() - End If - AdvancedCommand = False - BadCommand = False Case "shiftfetch" If Strings.AvailableFeature(8) = "1" Then If Strings.OnceInfo(0) = "Yes" Then @@ -254,9 +253,9 @@ Public Class Terminal BadCommand = False End If Case "shiftoriumfx" - 'ChangeInterpreter = True - 'AppHost("shiftoriumfx") - AdvancedCommand = False + 'ChangeInterpreter = True + 'AppHost("shiftoriumfx") + AdvancedCommand = False BadCommand = False Undeveloped() Case "shutdown", "shut down" @@ -285,6 +284,15 @@ Public Class Terminal End If AdvancedCommand = False BadCommand = False + Case "su" + If Strings.OnceInfo(0) = "Yes" Then + TextBox1.Text = TextBox1.Text & Environment.NewLine & "You already in root mode!" + Else + Strings.OnceInfo(0) = "Yes" + AssignPrompt() + End If + AdvancedCommand = False + BadCommand = False Case "ver" TextBox1.Text = TextBox1.Text & Environment.NewLine & "ShiftOS TheRevival version " & My.Resources.CurrentVersion AdvancedCommand = False @@ -434,11 +442,23 @@ 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 - + Select Case e.KeyData + Case (Keys.Control + Keys.Q) + If CurrentInterpreter = "terminal" Then + Else + TerminateApp() + PrintPrompt() + End If + End Select + 'Select Case e.KeyCode + ' Case e.KeyCode = Keys.T AndAlso e.Control + ' e.SuppressKeyPress = True + ' Case e.KeyCode = Keys.Q AndAlso e.Control + ' If CurrentInterpreter = "terminal" Then + ' Else + ' TerminateApp() + ' End If + 'End Select Select Case e.KeyCode Case Keys.ShiftKey TrackPos = TrackPos - 1 diff --git a/ShiftOS-TheRevival/MainForms/TerminalApps.vb b/ShiftOS-TheRevival/MainForms/TerminalApps.vb index b45cc0d..9731772 100644 --- a/ShiftOS-TheRevival/MainForms/TerminalApps.vb +++ b/ShiftOS-TheRevival/MainForms/TerminalApps.vb @@ -3,6 +3,7 @@ 'This is for GTN's RAM Public TheNumber As Integer = 0 Public FreezeText As String + 'Basic Calculator's RAM Public BC_ReadNumbers As Integer Public BC_Numbers1 As String Public BC_Numbers2 As String diff --git a/ShiftOS-TheRevival/MainForms/TerminalColorSystem.vb b/ShiftOS-TheRevival/MainForms/TerminalColorSystem.vb index 2dd8c85..9d2f6eb 100644 --- a/ShiftOS-TheRevival/MainForms/TerminalColorSystem.vb +++ b/ShiftOS-TheRevival/MainForms/TerminalColorSystem.vb @@ -204,6 +204,7 @@ Case "terminal" Terminal.TextBox1.BackColor = BgColor Terminal.TextBox1.ForeColor = FgColor + Strings.OnceInfo(3) = Bg & Fg End Select End Sub End Module diff --git a/ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj b/ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj index 81b06a6..74d2e24 100644 --- a/ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj +++ b/ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj @@ -99,6 +99,7 @@ Form + IntroStory.vb