mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:57:45 +00:00
ls: Show directories with the sticky bit in a special color
This makes /tmp show up with a green background in "ls" output.
This commit is contained in:
parent
e79c33eabb
commit
755938c650
1 changed files with 3 additions and 1 deletions
|
@ -105,7 +105,9 @@ int print_name(const struct stat& st, const String& name, const char* path_for_l
|
||||||
const char* begin_color = "";
|
const char* begin_color = "";
|
||||||
const char* end_color = "\033[0m";
|
const char* end_color = "\033[0m";
|
||||||
|
|
||||||
if (S_ISLNK(st.st_mode))
|
if (st.st_mode & S_ISVTX)
|
||||||
|
begin_color = "\033[42;30;1m";
|
||||||
|
else if (S_ISLNK(st.st_mode))
|
||||||
begin_color = "\033[36;1m";
|
begin_color = "\033[36;1m";
|
||||||
else if (S_ISDIR(st.st_mode))
|
else if (S_ISDIR(st.st_mode))
|
||||||
begin_color = "\033[34;1m";
|
begin_color = "\033[34;1m";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue