2025-01-08 20:35:08 +08:00
|
|
|
#include "filecomplete.h"
|
|
|
|
#include <iostream>
|
2025-01-09 09:07:16 +08:00
|
|
|
#include <string>
|
2025-01-21 13:21:37 +08:00
|
|
|
#include <thread>
|
|
|
|
|
2025-02-08 08:24:04 +08:00
|
|
|
static int cnt = 500;
|
2025-01-21 13:21:37 +08:00
|
|
|
|
|
|
|
// 测试光标位置
|
|
|
|
void delay_auto_show()
|
|
|
|
{
|
|
|
|
while (--cnt) {
|
2025-02-08 08:24:04 +08:00
|
|
|
std::this_thread::sleep_for(std::chrono::seconds(1));
|
2025-01-21 13:21:37 +08:00
|
|
|
std::cout << "IMCOMMING..............." << std::endl;
|
|
|
|
}
|
|
|
|
}
|
2025-01-08 20:35:08 +08:00
|
|
|
|
|
|
|
int main(int argc, char** argv)
|
|
|
|
{
|
2025-01-09 10:15:28 +08:00
|
|
|
std::cout << "PreContent1 " << std::endl;
|
|
|
|
std::cout << "PreContent2 " << std::endl;
|
2025-01-09 12:58:30 +08:00
|
|
|
fc_append('|');
|
2025-02-11 10:53:32 +08:00
|
|
|
fc_set_header("测试$:");
|
|
|
|
// std::thread t(delay_auto_show);
|
2025-01-21 13:21:37 +08:00
|
|
|
|
2025-01-08 20:35:08 +08:00
|
|
|
while (1) {
|
2025-01-09 10:15:28 +08:00
|
|
|
char* content = fc_readline();
|
2025-01-08 20:35:08 +08:00
|
|
|
if (content) {
|
2025-02-11 10:53:32 +08:00
|
|
|
std::string cmd_input(content);
|
2025-01-09 10:15:28 +08:00
|
|
|
fc_free(content);
|
2025-01-21 12:43:53 +08:00
|
|
|
std::cout << "" << std::endl;
|
2025-02-11 10:53:32 +08:00
|
|
|
std::cout << cmd_input << std::endl;
|
2025-01-08 20:35:08 +08:00
|
|
|
}
|
2025-02-18 04:57:33 +08:00
|
|
|
else {
|
|
|
|
break;
|
|
|
|
}
|
2025-01-08 20:35:08 +08:00
|
|
|
}
|
2025-01-21 13:21:37 +08:00
|
|
|
|
2025-02-11 10:53:32 +08:00
|
|
|
// t.join();
|
2025-01-08 20:35:08 +08:00
|
|
|
return 0;
|
|
|
|
}
|