aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS-TheRevival/MainForms/Terminal.vb
blob: e74f317ba751a35429da76b65dc3747ef07ce30a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
Imports System.IO

Public Class Terminal
    Public TrackPos As Integer
    Public RawCommand As String
    Public command As String
    Public DefaultPrompt As String
    Public AdvancedCommand As Boolean
    Public BadCommand As Boolean
    Public DisplayStory As Integer
    Public StoryToTell As String
    Public ChangeInterpreter As Boolean = False
    Public CurrentInterpreter As String = "terminal"
    Public CurrentDirectory As String
    Public Pseudodir As String
    Public StayAtChapter As Boolean = False
    Public ToolBarUse As Boolean = False
    Public ReleaseCursor As Boolean = False
    Public ShOSKey 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

    Public Sub InitializeTerminal()
        Strings.OnceInfo(1) = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS\ShiftFS"
        Strings.OnceInfo(4) = "!"
        Strings.OnceInfo(7) = Width
        Strings.OnceInfo(8) = Height
        If Strings.IsFree = True Then
            Strings.ComputerInfo(0) = "shiftos"
            Strings.ComputerInfo(1) = "user"
            CheckFeature()
            PrintPrompt()
            AssignPrompt()
        Else
            If StayAtChapter = True Then
                LoadGame()
                CheckFeature()
                PrintPrompt()
                AssignPrompt()
            Else
                If Strings.ComputerInfo(3) = "0" Then
                    TextBox1.ReadOnly = True
                    StayAtChapter = True
                    StoryOnlyTimer.Start()
                Else
                    LoadGame()
                    CheckFeature()
                    PrintPrompt()
                    AssignPrompt()
                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

    Public Sub CheckFeature()
        If Strings.AvailableFeature(4) = "1" Then
            If ToolBarUse = True Then
                If Strings.OnceInfo(2) = "True" Then
                    InfoBarTimer.Start()
                    TextBox1.Dock = DockStyle.None
                    ToolBar.Visible = True
                    ToolBar.SendToBack()
                    InfoBar.Visible = True
                    InfoBar.SendToBack()
                    TextBox1.Dock = DockStyle.Fill
                Else
                    TextBox1.Dock = DockStyle.None
                    InfoBar.Visible = False
                    ToolBar.Visible = True
                    ToolBar.SendToBack()
                    TextBox1.Dock = DockStyle.Fill
                End If
            Else
                If Strings.OnceInfo(2) = "True" Then
                    InfoBarTimer.Start()
                    TextBox1.Dock = DockStyle.None
                    InfoBar.Visible = True
                    InfoBar.SendToBack()
                    ToolBar.Visible = False
                    TextBox1.Dock = DockStyle.Fill
                Else
                    TextBox1.Dock = DockStyle.None
                    InfoBar.Visible = False
                    ToolBar.Visible = False
                    TextBox1.Dock = DockStyle.Fill
                End If
            End If
        Else
            TextBox1.Dock = DockStyle.None
            InfoBar.Visible = False
            TextBox1.Dock = DockStyle.Fill
        End If
    End Sub

    Public Sub PrintPrompt()
        If TextBox1.Text = Nothing Then
            If ChangeInterpreter = True Then
                TextBox1.Text = TextBox1.Text & Environment.NewLine & DefaultPrompt
            Else
                If Strings.OnceInfo(0) = "Yes" Then
                    TextBox1.Text = "root@" & Strings.ComputerInfo(0) & " #> "
                Else
                    TextBox1.Text = Strings.ComputerInfo(1) & "@" & Strings.ComputerInfo(0) & " $> "
                End If
            End If
        Else
            If ChangeInterpreter = True Then
                TextBox1.Text = TextBox1.Text & Environment.NewLine & DefaultPrompt
            Else
                If Strings.OnceInfo(0) = "Yes" Then
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "root@" & Strings.ComputerInfo(0) & " #> "
                Else
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & Strings.ComputerInfo(1) & "@" & Strings.ComputerInfo(0) & " $> "
                End If
            End If
        End If
    End Sub

    Public Sub AssignPrompt()
        If ChangeInterpreter = False Then
            If Strings.OnceInfo(0) = "Yes" Then
                DefaultPrompt = "root@" & Strings.ComputerInfo(0) & " #> "
            Else
                DefaultPrompt = Strings.ComputerInfo(1) & "@" & Strings.ComputerInfo(0) & " $> "
            End If
        End If
    End Sub

    Private Sub Undeveloped()
        TextBox1.Text = TextBox1.Text & Environment.NewLine & "Oopsie! It's only for newer version"
    End Sub

    Private Sub ReadCommand()
        command = TextBox1.Lines(TextBox1.Lines.Length - 1)
        If DefaultPrompt = Nothing Then
        Else
            command = command.Replace(DefaultPrompt, "")
        End If
        RawCommand = command
        command = command.ToLower()
    End Sub

    Private Sub DoCommand()
        AdvancedCommand = True
        BadCommand = True
        Select Case command
            Case ""
                AdvancedCommand = False
                BadCommand = False
            Case "bc"
                If Strings.AvailableFeature(9) = "1" Then
                    ChangeInterpreter = True
                    AppHost("bc", False)
                    AdvancedCommand = False
                    BadCommand = False
                End If
            Case "clear"
                If Strings.AvailableFeature(1) = "1" Then
                    TextBox1.Text = Nothing
                    AdvancedCommand = False
                    BadCommand = False
                End If
            Case "codepoint"
                TextBox1.Text = TextBox1.Text & Environment.NewLine & Strings.ComputerInfo(2) & " Codepoint(s) available in your wallet"
                AdvancedCommand = False
                BadCommand = False
            Case "colors"
                DisplayColors()
                AdvancedCommand = False
                BadCommand = False
            Case "dir"
                If Strings.AvailableFeature(16) = "1" Then
                    TerminalDirectories(CurrentDirectory)
                    AdvancedCommand = False
                    BadCommand = False
                End If
            Case "exit su"
                If Strings.OnceInfo(0) = "No" Then

                Else
                    AdvancedCommand = False
                    BadCommand = False
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "Exitting root mode..."
                    Strings.OnceInfo(0) = "No"
                    AssignPrompt()
                End If
            Case "guess"
                ChangeInterpreter = True
                AppHost("guess", False)
                AdvancedCommand = False
                BadCommand = False
                'Undeveloped()
            Case "gimme"
                Dim TempCP As Integer = Convert.ToInt32(Strings.ComputerInfo(2))
                TempCP = TempCP + 50
                Strings.ComputerInfo(2) = Convert.ToString(TempCP)
                TextBox1.Text = TextBox1.Text & Environment.NewLine & "you cheater!"
            Case "help"
                TextBox1.Text = TextBox1.Text & Environment.NewLine & "ShiftOS Help Manual" & Environment.NewLine & Environment.NewLine & "You can type 'help' to get all available commands and its corresponding action."
                If Strings.AvailableFeature(0) = 1 Then
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "To get help on each command, you can type 'man [command]'" & Environment.NewLine
                Else
                    TextBox1.Text = TextBox1.Text & Environment.NewLine
                End If
                If Strings.AvailableFeature(9) = 1 Then
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "BC          Basic Calculator for simple calculation"
                End If
                If Strings.AvailableFeature(16) = 1 Then
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "CD          Changes directory to a selected one"
                End If
                If Strings.AvailableFeature(1) = 1 Then
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "CLEAR       Clear the terminal"
                End If
                TextBox1.Text = TextBox1.Text & Environment.NewLine & "CODEPOINT   Display Codepoint(s) from your wallet"
                TextBox1.Text = TextBox1.Text & Environment.NewLine & "COLOR       Changes Terminal Text and Background color to the corresponding choice"
                TextBox1.Text = TextBox1.Text & Environment.NewLine & "COLORS      Shows available colors support for the terminal"
                If Strings.AvailableFeature(22) = 1 Then
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "COWSAY      Spawn a cow and saying anything you want"
                End If
                If Strings.AvailableFeature(16) = 1 Then
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "DEL         Delete a selected file from the directory"
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "DIR         Displays subdirectories and files in a directory"
                End If
                TextBox1.Text = TextBox1.Text & Environment.NewLine & "GUESS       Runs 'Guess the Number' application"
                TextBox1.Text = TextBox1.Text & Environment.NewLine & "HELP        Shows all commands available and its corresponding action"
                If Strings.AvailableFeature(20) = 1 Then
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "HOSTNAME    Sets the name of current hostname/computer name with a new one"
                End If
                If Strings.AvailableFeature(4) = 1 Then
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "INFOBAR     Displays informations about current session such as current app, current user, current time, etc."
                End If
                If Strings.AvailableFeature(0) = 1 Then
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "MAN         Shows a command, its corresponding action, and its example usage"
                End If
                If Strings.AvailableFeature(16) = 1 Then
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "MKDIR       Creating a directory"
                End If
                If Strings.AvailableFeature(16) = 1 Then
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "PWD         Display current directory navigated on ShiftOS"
                End If
                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(21) = 1 Then
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "REV         Turn any sentences you want and making it reversed"
                End If
                If Strings.AvailableFeature(16) = 1 Then
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "RMDIR       Deleting a directory"
                End If
                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"
                If Strings.AvailableFeature(17) = 1 Then
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "TEXTPAD     Simple text-editor for ShiftOS"
                End If
                If Strings.AvailableFeature(5) = 1 Then
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "TIME        Display the current time in the form of seconds since midnight"
                ElseIf Strings.AvailableFeature(5) = 3 Then
                    If Strings.AvailableFeature(6) = 1 Then
                        TextBox1.Text = TextBox1.Text & Environment.NewLine & "TIME        Display the current time in the form of minutes since midnight"
                    ElseIf Strings.AvailableFeature(6) = 3 Then
                        If Strings.AvailableFeature(7) = 1 Then
                            TextBox1.Text = TextBox1.Text & Environment.NewLine & "TIME        Display the current time in the form of hours since midnight"
                        ElseIf Strings.AvailableFeature(7) = 3 Then
                            If Strings.AvailableFeature(12) = 1 Then
                                TextBox1.Text = TextBox1.Text & Environment.NewLine & "TIME        Display the current time in the form of PM and AM format"
                            End If
                        End If
                    End If
                End If
                If Strings.AvailableFeature(20) = 1 Then
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "USERNAME    Sets the name of current user with a new one"
                End If
                TextBox1.Text = TextBox1.Text & Environment.NewLine & "VER         Printing current version of ShiftOS TheRevival"
                TextBox1.Text = TextBox1.Text & Environment.NewLine
                AdvancedCommand = False
                BadCommand = False
            Case "infobar"
                If Strings.AvailableFeature(4) = 1 Then
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & My.Resources.man_infobar
                End If
            Case "pwd"
                If Strings.AvailableFeature(16) = 1 Then
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & CurrentDirectory.Replace(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS\ShiftFS", "!")
                    AdvancedCommand = False
                    BadCommand = False
                End If
            Case "reboot"
                TextBox1.Text = Nothing
                AdvancedCommand = False
                BadCommand = False
                InitializeTerminal()
            Case "shiftorium"
                TextBox1.Text = TextBox1.Text & Environment.NewLine & My.Resources.man_shiftorium
                AdvancedCommand = False
                BadCommand = False
            Case "shiftfetch"
                If Strings.AvailableFeature(8) = "1" Then
                    If Strings.OnceInfo(0) = "Yes" Then
                        TextBox1.Text = TextBox1.Text & Environment.NewLine & Environment.NewLine & "                 :^!7?JJJJJ?7!^:                  root@shiftos"
                    Else
                        TextBox1.Text = TextBox1.Text & Environment.NewLine & Environment.NewLine & "                 :^!7?JJJJJ?7!^:                  user@shiftos"
                    End If
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "            .~?PB###BGP555PGB###BP?~.             ----------------------"
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "         .!P#&B57^..::^~~!!~^::~7YG&#5!.          OS: ShiftOS TheRevival"
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "       .?#@G7: .^               :^::!5&#?.        Host: " & Environment.MachineName
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "     .?#@5^  !                   .^!!..J&#?       Kernel: " & My.Resources.CurrentVersion
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "    ^B@G^ .J                        :7?..J@G:     Uptime: N/A"
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "   ~&@Y  7         ~PB&#Y:.           ~G7 ~&&^    Packages: " & Strings.ComputerInfo(4)
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "  ^&@Y  Y         5#5??YB@&B~          .GJ :&&:   Shell: sos-justshell"
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "  G@B  ?         5P      ^YB!           .#! ~@G   Window Manager: -"
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & " ^@@! :          @Y   .:::^~:.           7#  Y@^  Window Manager Theme: -"
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & " 7@@: !          B@&BBBBGPPB@#Y.         :&^ ^@?  Terminal: shiftos-terminal"
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & " ?@@: 7          :??7~:.    5@@5         :&^ .&?  Terminal Font: Consolas, 11pt"
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & " ~@@! !@    G#&B!.          Y@@B         7#.  Y~  CPU: " & My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0", "ProcessorNameString", Nothing)
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "  B@G  B@J   ...~&G.       7@@@?        .#?   7   GPU: N/A"
                    Dim TripleDigitRAM As String
                    TripleDigitRAM = (My.Computer.Info.TotalPhysicalMemory / 1024 / 1024 / 1024)
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "  ~&@? ^@Y       !G#57~~!YB@#Y^        .GP   ..   Memory: " & TripleDigitRAM.Substring(0, 4) & " GB"
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "   !@@7 ~#J        5#&&BG57^          ~BY         Codepoint: " & Strings.ComputerInfo(2)
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "    ~#@Y .5P~                       ^5G~          "
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "     .J&#! ^JY!:.                ^?P5!            "
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "       :J&B?..!JYY7!~::...::~!7Y5Y7:              "
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "         .7PBP?^::~!?JJJJJJJ?7~:                  "
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "            .~?55Y?!^:...                         "
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "                 .:~~^~^^::.                      "
                    AdvancedCommand = False
                    BadCommand = False
                End If
            Case "shiftoriumfx"
                'ChangeInterpreter = True
                'AppHost("shiftoriumfx")
                AdvancedCommand = False
                BadCommand = False
                Undeveloped()
            Case "shutdown", "shut down"
                TextBox1.Text = TextBox1.Text & Environment.NewLine & "Saving game..."
                If Strings.OnceInfo(6) = "story" Then
                    SaveGame()
                End If
                Cursor.Show()
                ShiftOSMenu.Show()
                Close()
            Case "textpad"
                If Strings.AvailableFeature(17) = "1" Then
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "Type any filename after 'textpad'!, ex: textpad text.txt"
                    AdvancedCommand = False
                    BadCommand = False
                End If
            Case "time"
                If Strings.AvailableFeature(5) = "1" Then
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & Math.Floor(Date.Now.Subtract(Date.Today).TotalSeconds) & " seconds passed since midnight"
                ElseIf Strings.AvailableFeature(5) = "3" Then
                    If Strings.AvailableFeature(6) = "1" Then
                        TextBox1.Text = TextBox1.Text & Environment.NewLine & Math.Floor(Date.Now.Subtract(Date.Today).TotalMinutes) & " minutes passed since midnight"
                    ElseIf Strings.AvailableFeature(6) = "3" Then
                        If Strings.AvailableFeature(7) = "1" Then
                            TextBox1.Text = TextBox1.Text & Environment.NewLine & Math.Floor(Date.Now.Subtract(Date.Today).TotalHours) & " hours passed since midnight"
                        ElseIf Strings.AvailableFeature(7) = "3" Then
                            If Strings.AvailableFeature(12) = "1" Then
                                If Date.Now.Hour < 12 Then
                                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "The time is " & TimeOfDay.Hour & " AM"
                                Else
                                    TextBox1.Text = TextBox1.Text & Environment.NewLine & "The time is " & TimeOfDay.Hour - 12 & " PM"
                                End If
                            End If
                        End If
                    End If
                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
                BadCommand = False
        End Select

        If AdvancedCommand = True Then
            If command Like "cat *" Then
                If Strings.AvailableFeature(16) = 1 Then
                    CatFile(command.Substring(4))
                    AdvancedCommand = False
                    BadCommand = False
                End If
            End If
            If command Like "cd *" Then
                If Strings.AvailableFeature(16) = 1 Then
                    NavigateDir(command.Replace("cd ", ""))
                    AdvancedCommand = False
                    BadCommand = False
                End If
            End If
            If command Like "color *" Then
                GetColor("terminal", command.Substring(6, 1), command.Substring(7, 1))
                BadCommand = False
            End If
            If command Like "cowsay *" Then
                If Strings.AvailableFeature(22) = 1 Then
                    Cowsay_Say(RawCommand.Substring(7))
                    BadCommand = False
                End If
            End If
            If command Like "del *" Then
                If Strings.AvailableFeature(16) = 1 Then
                    DeleteFile(RawCommand.Substring(4))
                    AdvancedCommand = False
                    BadCommand = False
                End If
            End If
            If command Like "hostname *" Then
                If Strings.AvailableFeature(20) = 1 Then
                    Strings.ComputerInfo(0) = command.Substring(command.LastIndexOf(" ") + 1, command.Length - (command.LastIndexOf(" ") + 1))
                    AssignPrompt()
                    AdvancedCommand = False
                    BadCommand = False
                End If
            End If
            If command Like "infobar *" Then
                If Strings.AvailableFeature(4) = "1" Then
                    'Infobar panel-ish and some sort
                    Dim infobarcommand As String = command.Replace("infobar ", "")
                    Dim advancedtool As Boolean = True
                    Select Case infobarcommand
                        Case "on"
                            Strings.OnceInfo(2) = "True"
                            CheckFeature()
                            BadCommand = False
                            advancedtool = False
                        Case "off"
                            Strings.OnceInfo(2) = "False"
                            CheckFeature()
                            BadCommand = False
                            advancedtool = False
                    End Select
                    If advancedtool = True Then
                        If infobarcommand Like "color *" Then
                            GetColor("infobar", infobarcommand.Substring(6, 1), infobarcommand.Substring(7, 1))
                            BadCommand = False
                        End If
                    End If
                End If
            End If
            If command Like "man *" Then
                If Strings.AvailableFeature(0) = "1" Then
                    Manual(command)
                End If
            End If
            If command Like "mkdir *" Then
                If Strings.AvailableFeature(16) Then
                    CreateDir(command.Replace("mkdir ", ""))
                    AdvancedCommand = False
                    BadCommand = False
                End If
            End If
            If command Like "print *" Then
                If Strings.AvailableFeature(2) = "1" Then
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & RawCommand.Substring(6)
                    'Dim printed As String = command.Replace("print ", "")
                    ''It has the same issue, only displays in lowercase
                    'TextBox1.Text = TextBox1.Text & Environment.NewLine & printed
                    BadCommand = False
                    AdvancedCommand = False
                End If
            End If
            If command Like "rev *" Then
                If Strings.AvailableFeature(21) = 1 Then
                    TextBox1.Text = TextBox1.Text & Environment.NewLine & StrReverse(RawCommand.Substring(4))
                    BadCommand = False
                    AdvancedCommand = False
                End If
            End If
            If command Like "rmdir *" Then
                If Strings.AvailableFeature(16) = 1 Then
                    RemoveDir(command.Replace("rmdir ", ""))
                    AdvancedCommand = False
                    BadCommand = False
                End If
            End If
            If command Like "shiftorium *" Then
                Dim prompt As String = command.Replace("shiftorium ", "")
                TextBox1.Text = TextBox1.Text & Environment.NewLine & "Shiftorium ShiftOS Center"
                If prompt Like "info *" Then
                    Shiftoriums.prompt = command.Replace("shiftorium info ", "")
                    Shiftorium_InformationFeatures()
                End If
                If prompt Like "install *" Then
                    Shiftoriums.prompt = command.Replace("shiftorium install ", "")
                    Shiftorium_DetectInstallFeatures()
                End If
                If prompt = "list" Then
                    Shiftorium_ListFeatures()
                    BadCommand = False
                End If
            End If
            If command Like "textpad *" Then
                If Strings.AvailableFeature(17) = 1 Then
                    ChangeInterpreter = True
                    command = RawCommand.Replace("textpad ", "")
                    AppHost("textpad", True)
                    AdvancedCommand = False
                    BadCommand = False
                End If
            End If
            If command Like "username *" Then
                If Strings.AvailableFeature(19) = 1 Then
                    If command.Substring(9) = "root" Then
                        TextBox1.Text = TextBox1.Text & Environment.NewLine & "This username is already taken!"
                    Else
                        Strings.ComputerInfo(1) = command.Substring(command.LastIndexOf(" ") + 1, command.Length - (command.LastIndexOf(" ") + 1))
                        AssignPrompt()
                    End If
                    AdvancedCommand = False
                    BadCommand = False
                End If
            End If
        End If

        If BadCommand = True Then
            TextBox1.Text = TextBox1.Text & Environment.NewLine & "Bad command or wrong file name"
        End If
    End Sub

    Public Sub TextRebind()
        TextBox1.Select(TextBox1.Text.Length, 0)
        TextBox1.ScrollToCaret()
    End Sub

    Private Sub txtterm_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
        TerminalApps.KeyInput = e.KeyData
        Select Case e.KeyData
            Case (Keys.Control + Keys.Q)
                If CurrentInterpreter = "terminal" Then
                Else
                    TerminateApp(TerminalApps.KeyInput)
                    TextRebind()
                End If
            Case Else
                CaptureKeyBinding(TerminalApps.KeyInput)
        End Select
        'If ReleaseCursor = True Then

        'Else
        '    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
        'End If

        '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 ReleaseCursor = True Then

        '    Else
        '        If e.KeyCode = Keys.Back Then
        '        Else
        '            TrackPos = TrackPos + 1
        '        End If
        '    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
        '        End If
        '    End If
        'End If
        'TextBox1.Select(TextBox1.TextLength, 0)
        'TextBox1.ScrollToCaret()
        If ReleaseCursor = True Then

        Else
            Select Case e.KeyData
                Case Keys.Enter
                    e.SuppressKeyPress = True
                    If TextBox1.ReadOnly = True Then

                    Else
                        ReadCommand()
                        If Strings.AvailableFeature(18) = 1 Then
                            ShOSKey_InputCommand(command)
                        End If
                        If ChangeInterpreter = True Then
                            DoChildCommand()
                            PrintPrompt()
                            TextRebind()
                        Else
                            DoCommand()
                            PrintPrompt()
                            TextRebind()
                        End If
                    End If
                    TrackPos = 0
                Case Keys.ShiftKey, Keys.Alt, Keys.ControlKey, Keys.LWin, Keys.RWin
                    e.SuppressKeyPress = True
                Case Keys.Back
                    If TrackPos <= 0 Then
                        e.SuppressKeyPress = True
                    Else
                        TrackPos = TrackPos - 1
                        'If TextBox1.SelectedText.Length < 1 Then
                        '    TrackPos = TrackPos - 1
                        'Else
                        '    e.SuppressKeyPress = True
                        'End If
                    End If
                Case Keys.Right
                    If TextBox1.SelectionStart = TextBox1.TextLength Then
                    Else
                        TrackPos = TrackPos + 1
                    End If
                    'If TrackPos <= 0 Then
                    '    Dim CommandChar As String
                    '    CommandChar = TextBox1.Lines(TextBox1.Lines.Length - 1)
                    '    CommandChar = CommandChar.Replace(DefaultPrompt, "")
                    '    TrackPos = CommandChar.Length - 1
                    '    TextBox1.Select(TextBox1.TextLength, 0)
                    '    TextBox1.ScrollToCaret()
                    'End If
                Case Keys.Left
                    If TextBox1.SelectionStart = 0 Then
                        e.SuppressKeyPress = True
                    Else
                        TrackPos = TrackPos - 1
                    End If
                    If TrackPos <= 0 Then
                        Dim CommandChar As String
                        CommandChar = TextBox1.Lines(TextBox1.Lines.Length - 1)
                        CommandChar = CommandChar.Replace(DefaultPrompt, "")
                        TrackPos = CommandChar.Length - 1
                        TextBox1.Select(TextBox1.TextLength, 0)
                        TextBox1.ScrollToCaret()
                    End If
                'If TrackPos < 1 Then
                '    e.SuppressKeyPress = True
                '    TrackPos = TrackPos - 1
                'Else
                '    TrackPos = TrackPos - 2
                'End If
                Case Keys.Up
                    e.SuppressKeyPress = True
                    If Strings.AvailableFeature(18) = 1 Then
                        ShOSKey_Display()
                        TextRebind()
                    End If
                Case Keys.Down
                    e.SuppressKeyPress = True
                    If Strings.AvailableFeature(18) = 1 Then
                        ShOSKey_Display()
                        TextRebind()
                    End If
                Case Else
                    TrackPos = TrackPos + 1
            End Select
        End If
        'If e.KeyCode = Keys.Enter Then
        '    'If command = "clear" Then
        '    '    txtterm.Text = txtterm.Text + ShiftOSDesktop.username & "@" & ShiftOSDesktop.osname & " $> "
        '    '    txtterm.Select(txtterm.Text.Length, 0)

        '    'Else
        '    '    txtterm.Text = txtterm.Text + Environment.NewLine & ShiftOSDesktop.username & "@" & ShiftOSDesktop.osname & " $> "
        '    '    txtterm.Select(txtterm.Text.Length, 0)
        '    'End If
        '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
        '    '    End If
        '    'End If
        'End If
    End Sub

    Private Sub TextBox1_Click(sender As Object, e As EventArgs) Handles TextBox1.Click, TextBox1.MouseDoubleClick
        TextBox1.Select(TextBox1.TextLength, 0)
        TextBox1.ScrollToCaret()
    End Sub

    Private Sub StoryOnlyTimer_Tick(sender As Object, e As EventArgs) Handles StoryOnlyTimer.Tick
        Select Case Strings.ComputerInfo(3)
            Case "0"
                Select Case DisplayStory
                    Case 5
                        TextBox1.Text = "Connected to <null>"
                    Case 25
                        TextBox1.Text = TextBox1.Text & Environment.NewLine & "<null>: Hey there, Unknown user!"
                    Case 60
                        TextBox1.Text = TextBox1.Text & Environment.NewLine & "<null>: Congratulaions! You have been involuntarily selected for a test on my experimental operating system, ShiftOS."
                    Case 125
                        TextBox1.Text = TextBox1.Text & Environment.NewLine & "<null>: ShiftOS is an operating system that will evolve itself as you use it as I progressively add more features into ShiftOS."
                    Case 160
                        TextBox1.Text = TextBox1.Text & Environment.NewLine & "<null>: Currently ShiftOS isn't much from a basic command-line operating system."
                    Case 210
                        TextBox1.Text = TextBox1.Text & Environment.NewLine & "<null>: I don't wish to reveal my indentity at this point in time."
                    Case 270
                        TextBox1.Text = TextBox1.Text & Environment.NewLine & "<null>: I will install ShiftOS on your system once I leave while I work on... something else."
                    Case 335
                        TextBox1.Text = TextBox1.Text & Environment.NewLine & "<null>: Once you have ShiftOS rich feature enough, I will come back to you. In the mean time, goodbye!"
                    Case 400
                        TextBox1.Text = TextBox1.Text & Environment.NewLine & "<null> Disconnected"
                    Case 430
                        TextBox1.Text = "Installing ShiftOS..."
                    Case 550
                        TextBox1.Text = "ShiftOS Installed, The computer will restart in a few seconds"
                    Case 600
                        StoryOnlyTimer.Stop()
                        TextBox1.Text = Nothing
                        TextBox1.ReadOnly = False
                        Strings.ComputerInfo(0) = "shiftos"
                        Strings.ComputerInfo(1) = "user"
                        CheckFeature()
                        PrintPrompt()
                        AssignPrompt()
                        TextBox1.Select(TextBox1.TextLength, 0)
                        TextBox1.ScrollToCaret()
                End Select
        End Select
        DisplayStory = DisplayStory + 1
    End Sub

    Private Sub InfoBarTimer_Tick(sender As Object, e As EventArgs) Handles InfoBarTimer.Tick
        InfoBar.Text = "|"
        If Strings.AvailableFeature(5) = "1" Then
            InfoBar.Text = InfoBar.Text & " " & Math.Floor(Date.Now.Subtract(Date.Today).TotalSeconds) & " |"
        ElseIf Strings.AvailableFeature(5) = "3" Then
            If Strings.AvailableFeature(6) = "1" Then
                InfoBar.Text = InfoBar.Text & " " & Math.Floor(Date.Now.Subtract(Date.Today).TotalMinutes) & " |"
            ElseIf Strings.AvailableFeature(6) = "3" Then
                If Strings.AvailableFeature(7) = "1" Then
                    InfoBar.Text = InfoBar.Text & " " & Math.Floor(Date.Now.Subtract(Date.Today).TotalHours) & " |"
                ElseIf Strings.AvailableFeature(7) = "3" Then
                    If Strings.AvailableFeature(12) = "1" Then
                        If Date.Now.Hour < 12 Then
                            InfoBar.Text = InfoBar.Text & Environment.NewLine & " " & TimeOfDay.Hour & " AM |"
                        Else
                            InfoBar.Text = InfoBar.Text & Environment.NewLine & " " & TimeOfDay.Hour - 12 & " PM |"
                        End If
                    End If
                End If
            End If
        End If
        If Strings.OnceInfo(0) = "Yes" Then
            InfoBar.Text = InfoBar.Text & " root |"
        Else
            InfoBar.Text = InfoBar.Text & " user |"
        End If
        InfoBar.Text = InfoBar.Text & " " & CurrentInterpreter & " |"
        InfoBar.Text = InfoBar.Text & " " & Strings.ComputerInfo(2) & " CP |"
        InfoBar.Text = InfoBar.Text & " " & TrackPos & " |"
    End Sub

    Private Sub TextBox1_Click(sender As Object, e As MouseEventArgs) Handles TextBox1.MouseDoubleClick, TextBox1.Click

    End Sub
End Class