浏览代码

added username to prompt in autocomplete

stefan 1 年之前
父节点
当前提交
2f88fd3aec
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      src/shellmatta_autocomplete.c

+ 7 - 0
src/shellmatta_autocomplete.c

@@ -95,6 +95,13 @@ void autocomplete_run(shellmatta_instance_t *inst)
         if(printedLen > 0u)
         {
             utils_writeEcho(inst, "\r\n", 2u);
+#ifdef SHELLMATTA_AUTHENTICATION
+            if (NULL != inst->userPointer)
+            {
+                utils_writeEcho(inst, inst->userPointer->username, strlen(inst->userPointer->username));
+                utils_writeEcho(inst, "@", 1);
+            }
+#endif
             utils_writeEcho(inst, inst->prompt, strlen(inst->prompt));
             utils_writeEcho(inst, inst->buffer, inst->inputCount);
             tempCursor = inst->cursor;