Added plugin
This commit is contained in:
parent
fda738e711
commit
ec6c216057
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
}
|
|
@ -57,4 +57,7 @@ struct Session
|
|||
struct TTY* teletype;
|
||||
|
||||
char* name;
|
||||
|
||||
char* status;
|
||||
unsigned int statusLength;
|
||||
};
|
Loading…
Reference in New Issue