sophuwu.site > bashprompt
layout
sophuwu sophie@skisiel.com
Thu, 25 Apr 2024 00:48:39 +0200
commit

8c66816e9e421a2635774fed2cecd1951834250c

parent

22babeda39f9f625522646b3ffc8418829871e2b

1 files changed, 3 insertions(+), 0 deletions(-)

jump to
M src/prompt.cppsrc/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");