Ver Fonte

added username to prompt in autocomplete

stefan há 1 ano atrás
pai
commit
2f88fd3aec
1 ficheiros alterados com 7 adições e 0 exclusões
  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;