printf("\x1B[?1047h");
printf("\x1B[%i;%ir", 0, giTerminal_Height-1);
- SetCursorPos(giTerminal_Height-1, 0);
+ SetCursorPos(giTerminal_Height-1, 1);
printf("[(status)] ");
// HACK: Static server entry
int MainLoop(void)
{
- SetCursorPos(giTerminal_Height-1, 0);
+ SetCursorPos(giTerminal_Height-1, 1);
printf("[(status)] ");
fflush(stdout);
}
free(cmd);
// Prompt
- SetCursorPos(giTerminal_Height-1, 0);
+ SetCursorPos(giTerminal_Height-1, 1);
printf("\x1B[2K"); // Clear line
if( gpCurrentWindow->Name[0] )
printf("[%s:%s] ",
{
printf("\33[s");
printf("\33[T"); // Scroll down 1 (free space below)
- SetCursorPos(giTerminal_Height-2, 0);
+ SetCursorPos(giTerminal_Height-2, 1);
int prefixlen = strlen(Source) + 3;
int avail = giTerminal_Width - prefixlen;
int msglen = strlen(Message);
msglen -= avail;
Message += avail;
printf("\33[T");
- SetCursorPos(giTerminal_Height-2, prefixlen);
+ SetCursorPos(giTerminal_Height-2, prefixlen+1);
printf("%.*s", avail, Message);
}
printf("\x1b[u");
int i = 0, done = 0;
y -= msglen / line_avail; // Extra lines (y-- above handles the 1 line case)
- SetCursorPos(y, 0);
+ SetCursorPos(y, 1);
printf("[%s] ", msg->Source);
while(done < msglen) {
done += printf("%.*s", line_avail, msg->Data+done);
i ++;
- SetCursorPos(y+i, prefix_len);
+ SetCursorPos(y+i, prefix_len+1);
}
}
const char *cmd = GetValue(Line, &pos);
if( strcmp(cmd, "PING") == 0 ) {
- writef(Server->FD, "PONG %s\n", gsHostname);
-
+ writef(Server->FD, "PONG %s\n", Line+pos);
}
else {
// Command to client