Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 54 of file prompt.c.
Referenced by Batch(), ReadCommand(), ReadLine(), and RunInstance().
{ static TCHAR default_pr[] = _T("$P$G"); TCHAR szPrompt[256]; LPTSTR pr; if (GetEnvironmentVariable (_T("PROMPT"), szPrompt, 256)) pr = szPrompt; else pr = default_pr; while (*pr) { if (*pr != _T('$')) { ConOutChar (*pr); } else { pr++; switch (_totupper (*pr)) { case _T('A'): ConOutChar (_T('&')); break; case _T('B'): ConOutChar (_T('|')); break; case _T('C'): ConOutChar (_T('(')); break; case _T('D'): ConOutPrintf(_T("%s"), GetDateString()); break; case _T('E'): ConOutChar (_T('\x1B')); break; case _T('F'): ConOutChar (_T(')')); break; case _T('G'): ConOutChar (_T('>')); break; case _T('H'): ConOutChar (_T('\x08')); ConOutChar (_T(' ')); ConOutChar (_T('\x08')); break; case _T('L'): ConOutChar (_T('<')); break; case _T('N'): { TCHAR szPath[MAX_PATH]; GetCurrentDirectory (MAX_PATH, szPath); ConOutChar (szPath[0]); } break; case _T('P'): { TCHAR szPath[MAX_PATH]; GetCurrentDirectory (MAX_PATH, szPath); ConOutPrintf (_T("%s"), szPath); } break; case _T('Q'): ConOutChar (_T('=')); break; case _T('S'): ConOutChar (_T(' ')); break; case _T('T'): ConOutPrintf(_T("%s"), GetTimeString()); break; case _T('V'): switch (osvi.dwPlatformId) { case VER_PLATFORM_WIN32_WINDOWS: if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 1) ConOutPrintf (_T("Windows 98")); else ConOutPrintf (_T("Windows 95")); break; case VER_PLATFORM_WIN32_NT: ConOutPrintf (_T("Windows NT Version %lu.%lu"), osvi.dwMajorVersion, osvi.dwMinorVersion); break; } break; case _T('_'): ConOutChar (_T('\n')); break; case '$': ConOutChar (_T('$')); break; #ifdef FEATURE_DIRECTORY_STACK case '+': { INT i; for (i = 0; i < GetDirectoryStackDepth (); i++) ConOutChar (_T('+')); } break; #endif } } pr++; } }