1: # 2: /* This is the main loop of vsh. Each interation processes a command. 3: Commands are one character long. They are acquired in raw mode 4: and processed without the need to press return. The goal of vsh 5: is to minimize keypresses as much as possible. 6: */ 7: 8: #include "hd.h" 9: 10: process () { 11: 12: register cmd, next; /* single character command */ 13: 14: next = REPLOT; 15: for (;;) { /* loop forever */ 16: if (next & REPLOT) dispdir (1); 17: at (2301); 18: printf (" \b"); 19: cmd = getch (); 20: putch ('\b'); 21: 22: next = command (cmd, DIRCMD); 23: } 24: }