mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 02:29:21 +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
Notes:
sideshowbarker
2024-07-19 15:57:08 +09:00
Author: https://github.com/awesomekling
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