Added plugin
This commit is contained in:
parent
fda738e711
commit
ec6c216057
|
@ -396,8 +396,8 @@ void newEditor(struct Session* session)
|
||||||
}
|
}
|
||||||
|
|
||||||
//printf("%c\n",s);
|
//printf("%c\n",s);
|
||||||
char* l = malloc(20);
|
// char* l = malloc(20);
|
||||||
sprintf(l, "%u", s);
|
// sprintf(l, "%u", s);
|
||||||
// output(l, strlen(l));
|
// output(l, strlen(l));
|
||||||
// output(&s, 1);
|
// output(&s, 1);
|
||||||
|
|
||||||
|
@ -413,6 +413,8 @@ void newEditor(struct Session* session)
|
||||||
char* bye = "\nBye mate!\n";
|
char* bye = "\nBye mate!\n";
|
||||||
output(bye, strlen(bye));
|
output(bye, strlen(bye));
|
||||||
|
|
||||||
|
/* Clean up commands */
|
||||||
|
|
||||||
/* Restore tty settings */
|
/* Restore tty settings */
|
||||||
stopTTY();
|
stopTTY();
|
||||||
|
|
||||||
|
|
|
@ -19,18 +19,26 @@ void dispatch(struct Session* session)
|
||||||
unsigned int i = 0;
|
unsigned int i = 0;
|
||||||
|
|
||||||
/* STatus line */
|
/* STatus line */
|
||||||
session->status = malloc(100);
|
session->status = malloc(columns);
|
||||||
*session->status=0;
|
*session->status=0;
|
||||||
|
|
||||||
/* Add name */
|
/* Add name */
|
||||||
strcat(session->status, "[");
|
strcat(session->status, "🐻️️[");
|
||||||
strcat(session->status, session->name);
|
strcat(session->status, session->name);
|
||||||
strcat(session->status, "]");
|
strcat(session->status, "]");
|
||||||
|
|
||||||
|
strcat(session->status, "(");
|
||||||
|
char* temp = malloc(20);
|
||||||
|
sprintf(temp, "%u", session->size);
|
||||||
|
strcat(session->status, temp);
|
||||||
|
strcat(session->status, ")");
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
while(i < columns-strlen(session->name)-2)
|
while(i < columns-strlen(session->name)-2-strlen(temp)-2-2)
|
||||||
{
|
{
|
||||||
strcat(session->status, "-");
|
strcat(session->status, "-");
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//free(temp);
|
||||||
}
|
}
|
|
@ -57,4 +57,7 @@ struct Session
|
||||||
struct TTY* teletype;
|
struct TTY* teletype;
|
||||||
|
|
||||||
char* name;
|
char* name;
|
||||||
|
|
||||||
|
char* status;
|
||||||
|
unsigned int statusLength;
|
||||||
};
|
};
|
Loading…
Reference in New Issue