layout
sophuwu sophie@skisiel.com
Thu, 25 Apr 2024 00:48:39 +0200
1 files changed,
3 insertions(+),
0 deletions(-)
jump to
M
src/prompt.cpp
→
src/prompt.cpp
@@ -68,6 +68,9 @@ for (int i = 0; i < 4; i++)ipaddr[i] = unhex(ip[2*i])<<4 | unhex(ip[2*i+1]);
for (int i = 0; i < host.length(); i++) printf("\033[38;2;%d;%d;%dm%c",ipaddr[i%3],ipaddr[i+1%3],ipaddr[2+i%3],host[i]); printf("\033[0m\n"); + for (int i = 0; i < 4; i++) + printf("\033[48;5;%d;38;5;%dm%c",ipaddr[i],ipaddr[3-i],ip[i*2]); + printf("\033[0m\n");