#ifndef CPCTRL_NONCANONICAL_H #define CPCTRL_NONCANONICAL_H #include #include #include #include #include #include #if defined(_WIN32) #include #include #else #include #include #endif //#include "GlobalDefs.h" extern std::vector cmdList; // 平台相关类型定义 #if defined(_WIN32) typedef DWORD terminal_mode_t; #else typedef struct termios terminal_mode_t; #endif // 全局保存终端原始设置 extern terminal_mode_t original_termios; void restore_terminal(); void set_noncanonical_mode(); std::string toLower(const std::string& str); std::string tabCompletion(const std::string& currentLine, size_t cursorPos); std::string readLine(const std::string& prompt); #endif //CPCTRL_NONCANONICAL_H