From fcd61b381af7adbd21636a4c26e67a035c6bd01e Mon Sep 17 00:00:00 2001
From: taynpg <taynpg@163.com>
Date: Tue, 21 Jan 2025 13:03:26 +0800
Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E5=B0=9D=E8=AF=95=E5=A4=84?=
 =?UTF-8?q?=E7=90=86win=E4=B8=8B=E5=9B=9E=E8=BD=A6=E5=90=8E=E5=8F=AF?=
 =?UTF-8?q?=E8=83=BD=E5=AF=BC=E8=87=B4=E7=9A=84=E6=AE=8B=E7=95=99=E5=85=89?=
 =?UTF-8?q?=E6=A0=87=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 filecomplete.cpp | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/filecomplete.cpp b/filecomplete.cpp
index 82ec7ee..0b2bf80 100644
--- a/filecomplete.cpp
+++ b/filecomplete.cpp
@@ -501,6 +501,14 @@ char* fc_readline()
     std::chrono::time_point<std::chrono::high_resolution_clock> p1, p2;
     p1 = std::chrono::high_resolution_clock::now();
 
+#if defined(OS_WINDOWS)
+    HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
+    CONSOLE_CURSOR_INFO cursorInfo;
+    GetConsoleCursorInfo(hConsole, &cursorInfo);
+    cursorInfo.bVisible = TRUE;
+    SetConsoleCursorInfo(hConsole, &cursorInfo);
+#endif
+
     while (1) {
         word.clear();
         clear_line();
@@ -540,6 +548,13 @@ char* fc_readline()
 
         switch (ch) {
         case ENTER:
+#if defined(OS_WINDOWS)
+            hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
+            CONSOLE_CURSOR_INFO cursorInfo;
+            GetConsoleCursorInfo(hConsole, &cursorInfo);
+            cursorInfo.bVisible = FALSE;
+            SetConsoleCursorInfo(hConsole, &cursorInfo);
+#endif
             append_his(main_buf);
             return main_buf;
 #if defined(OS_WINDOWS)