mirror of
1
0
Fork 0

Added plugin

This commit is contained in:
Tristan B. Kildaire 2020-05-06 20:34:43 +02:00
parent fda738e711
commit ec6c216057
3 changed files with 18 additions and 5 deletions

View File

@ -396,8 +396,8 @@ void newEditor(struct Session* session)
}
//printf("%c\n",s);
char* l = malloc(20);
sprintf(l, "%u", s);
// char* l = malloc(20);
// sprintf(l, "%u", s);
// output(l, strlen(l));
// output(&s, 1);
@ -412,6 +412,8 @@ void newEditor(struct Session* session)
char* bye = "\nBye mate!\n";
output(bye, strlen(bye));
/* Clean up commands */
/* Restore tty settings */
stopTTY();

View File

@ -19,18 +19,26 @@ void dispatch(struct Session* session)
unsigned int i = 0;
/* STatus line */
session->status = malloc(100);
session->status = malloc(columns);
*session->status=0;
/* Add name */
strcat(session->status, "[");
strcat(session->status, "🐻️️[");
strcat(session->status, session->name);
strcat(session->status, "]");
strcat(session->status, "(");
char* temp = malloc(20);
sprintf(temp, "%u", session->size);
strcat(session->status, temp);
strcat(session->status, ")");
i = 0;
while(i < columns-strlen(session->name)-2)
while(i < columns-strlen(session->name)-2-strlen(temp)-2-2)
{
strcat(session->status, "-");
i++;
}
//free(temp);
}

View File

@ -57,4 +57,7 @@ struct Session
struct TTY* teletype;
char* name;
char* status;
unsigned int statusLength;
};