patch 9.0.1855: mode() doesn't indicate command line for terminal

Problem:  mode() doesn't indicate command line for terminal
Solution: make it return 'ct' for command-line from Terminal mode

closes: #6265
closes: #13017
closes: #13018

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: h-east <h.east.727@gmail.com>
diff --git a/src/misc1.c b/src/misc1.c
index 7208350..5b008c6 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -664,7 +664,11 @@
     }
 #ifdef FEAT_TERMINAL
     else if (term_use_loop())
+    {
+	if (State & MODE_CMDLINE)
+	    buf[i++] = 'c';
 	buf[i++] = 't';
+    }
 #endif
     else if (VIsual_active)
     {