diff --git a/ShiftOS-TheRevival/API/TerminalAPI.vb b/ShiftOS-TheRevival/API/TerminalAPI.vb index 6003d9e..e28f222 100644 --- a/ShiftOS-TheRevival/API/TerminalAPI.vb +++ b/ShiftOS-TheRevival/API/TerminalAPI.vb @@ -231,6 +231,9 @@ NormalCommand() SaveGame() InitializeTerminal() + 'Case "secure" + ' Console.Secure = True + ' Console.TextBox1.ReadOnly = True Case "shiftorium" NewLine(My.Resources.man_shiftorium) AdvancedCommand = False diff --git a/ShiftOS-TheRevival/MainForms/Console.vb b/ShiftOS-TheRevival/MainForms/Console.vb index c9f4ae9..3ae1603 100644 --- a/ShiftOS-TheRevival/MainForms/Console.vb +++ b/ShiftOS-TheRevival/MainForms/Console.vb @@ -15,6 +15,8 @@ Public Class Console Public ToolBarUse As Boolean = False 'Either any program is using ToolBar or not Public ReleaseCursor As Boolean = False 'Release cursor from TrackPos Public ShOSKey As String 'DOSKEY tracking string for ShiftOS + Public Secure As Boolean 'Define either Secure Text mode is enabled or not (experimental!) + Public SecureString As String 'String for Secure Text mode (experimental) Private Sub Console_Load(sender As Object, e As EventArgs) Handles MyBase.Load With ShortcutHandler @@ -35,21 +37,31 @@ Public Class Console Select Case e.KeyData Case Keys.Enter e.SuppressKeyPress = True - If TextBox1.ReadOnly = True Then - - Else + If Secure = True Then + Secure = False + TextBox1.ReadOnly = False Terminal_ReadCommand() - If Strings.AvailableFeature(18) = 1 Then - ShOSKey_InputCommand(command) - End If - If ChangeInterpreter = True Then - DoChildCommand() - Terminal_PrintPrompt() - TextRebind() + NewLine(SecureString) + Terminal_PrintPrompt() + SecureString = Nothing + TextRebind() + Else + If TextBox1.ReadOnly = True Then + Else - Terminal_DoCommand() - Terminal_PrintPrompt() - TextRebind() + Terminal_ReadCommand() + If Strings.AvailableFeature(18) = 1 Then + ShOSKey_InputCommand(command) + End If + If ChangeInterpreter = True Then + DoChildCommand() + Terminal_PrintPrompt() + TextRebind() + Else + Terminal_DoCommand() + Terminal_PrintPrompt() + TextRebind() + End If End If End If TrackPos = 0 @@ -113,7 +125,15 @@ Public Class Console TextRebind() End If Case Else - TrackPos = TrackPos + 1 + If Secure = True Then + If e.Modifiers = Keys.Shift Then + SecureString = SecureString & Chr(e.KeyValue) + Else + SecureString = SecureString & Chr(e.KeyValue + 32) + End If + Else + TrackPos = TrackPos + 1 + End If End Select End If 'If e.KeyCode = Keys.Enter Then