1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 21:48:13 +00:00

Terminal: Support setting the window title using Xterm escape sequences.

Use this in the /bin/sh prompt to keep the window title in sync with the
shell's working directory. :^)
This commit is contained in:
Andreas Kling 2019-01-25 05:51:39 +01:00
parent 5f14e22a31
commit 5adaeeaa3b
3 changed files with 60 additions and 1 deletions

View file

@ -26,8 +26,10 @@ static void prompt()
{
if (g->uid == 0)
printf("# ");
else
else {
printf("\033]0;%s@%s:%s\007", g->username.characters(), g->hostname, g->cwd.characters());
printf("\033[31;1m%s\033[0m@\033[37;1m%s\033[0m:\033[32;1m%s\033[0m$> ", g->username.characters(), g->hostname, g->cwd.characters());
}
fflush(stdout);
}