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:
parent
5f14e22a31
commit
5adaeeaa3b
3 changed files with 60 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue