mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Added timestamp to gotty prompt
This commit is contained in:
parent
799070fd3e
commit
b6c1135d69
4 changed files with 74 additions and 3 deletions
|
|
@ -34,6 +34,7 @@
|
|||
#include "gotty/tty.h"
|
||||
#include "gotty/print.h"
|
||||
#include "gotty/options.h"
|
||||
#include "gotty/time.h"
|
||||
|
||||
static int connected = false;
|
||||
struct termios new_stdout, old_stdout, old_tio;
|
||||
|
|
@ -121,7 +122,7 @@ void disconnect_tty(void)
|
|||
{
|
||||
if (tainted)
|
||||
putchar('\n');
|
||||
color_printf("[gotty] Disconnected");
|
||||
color_printf("[gotty %s] Disconnected", current_time());
|
||||
close(fd);
|
||||
connected = false;
|
||||
}
|
||||
|
|
@ -159,7 +160,7 @@ int connect_tty(void)
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
color_printf("[gotty] Connected");
|
||||
color_printf("[gotty %s] Connected", current_time());
|
||||
connected = true;
|
||||
tainted = false;
|
||||
bzero(&c_stdin[0], 3);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue